forked from lucianoforks/falling-block-puzzle-game-os
Fixed linux builds
This commit is contained in:
29
Makefile
29
Makefile
@ -1,6 +1,14 @@
|
|||||||
CC=i386-elf-gcc
|
UNAME := $(shell uname)
|
||||||
ASM=i386-elf-as
|
|
||||||
LD=i386-elf-ld
|
ifeq ($(UNAME),Linux)
|
||||||
|
CC=gcc -elf_i386
|
||||||
|
AS=as --32
|
||||||
|
LD=ld -m elf_i386
|
||||||
|
else
|
||||||
|
CC=i386-elf-gcc
|
||||||
|
AS=i386-elf-as
|
||||||
|
LD=i386-elf-ld
|
||||||
|
endif
|
||||||
|
|
||||||
GFLAGS=
|
GFLAGS=
|
||||||
CCFLAGS=-m32 -std=c11 -O2 -g -Wall -Wextra -Wpedantic -Wstrict-aliasing
|
CCFLAGS=-m32 -std=c11 -O2 -g -Wall -Wextra -Wpedantic -Wstrict-aliasing
|
||||||
@ -29,16 +37,19 @@ dirs:
|
|||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm ./**/*.o
|
rm -f ./**/*.o
|
||||||
rm ./*.iso
|
rm -f ./*.iso
|
||||||
rm ./**/*.elf
|
rm -f ./**/*.elf
|
||||||
rm ./**/*.bin
|
rm -f ./**/*.bin
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) -o $@ -c $< $(GFLAGS) $(CCFLAGS)
|
$(CC) -o $@ -c $< $(GFLAGS) $(CCFLAGS)
|
||||||
|
|
||||||
%.o: %.S
|
%.o: %.S
|
||||||
$(ASM) -o $@ -c $< $(GFLAGS) $(ASFLAGS)
|
$(AS) -o $@ -c $< $(GFLAGS) $(ASFLAGS)
|
||||||
|
|
||||||
|
dirs:
|
||||||
|
mkdir -p bin
|
||||||
|
|
||||||
bootsect: $(BOOTSECT_OBJS)
|
bootsect: $(BOOTSECT_OBJS)
|
||||||
$(LD) -o ./bin/$(BOOTSECT) $^ -Ttext 0x7C00 --oformat=binary
|
$(LD) -o ./bin/$(BOOTSECT) $^ -Ttext 0x7C00 --oformat=binary
|
||||||
@ -46,7 +57,7 @@ bootsect: $(BOOTSECT_OBJS)
|
|||||||
kernel: $(KERNEL_OBJS)
|
kernel: $(KERNEL_OBJS)
|
||||||
$(LD) -o ./bin/$(KERNEL) $^ $(LDFLAGS) -Tsrc/link.ld
|
$(LD) -o ./bin/$(KERNEL) $^ $(LDFLAGS) -Tsrc/link.ld
|
||||||
|
|
||||||
iso: bootsect kernel
|
iso: dirs bootsect kernel
|
||||||
dd if=/dev/zero of=boot.iso bs=512 count=2880
|
dd if=/dev/zero of=boot.iso bs=512 count=2880
|
||||||
dd if=./bin/$(BOOTSECT) of=boot.iso conv=notrunc bs=512 seek=0 count=1
|
dd if=./bin/$(BOOTSECT) of=boot.iso conv=notrunc bs=512 seek=0 count=1
|
||||||
dd if=./bin/$(KERNEL) of=boot.iso conv=notrunc bs=512 seek=1 count=2048
|
dd if=./bin/$(KERNEL) of=boot.iso conv=notrunc bs=512 seek=1 count=2048
|
||||||
|
@ -736,6 +736,7 @@ void _main(u32 magic) {
|
|||||||
render();
|
render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_MUSIC
|
||||||
if (keyboard_char('m')) {
|
if (keyboard_char('m')) {
|
||||||
if (!last_music_toggle) {
|
if (!last_music_toggle) {
|
||||||
state.music = !state.music;
|
state.music = !state.music;
|
||||||
@ -746,6 +747,7 @@ void _main(u32 magic) {
|
|||||||
} else {
|
} else {
|
||||||
last_music_toggle = false;
|
last_music_toggle = false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
screen_swap();
|
screen_swap();
|
||||||
state.frames++;
|
state.frames++;
|
||||||
|
Reference in New Issue
Block a user