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
|
||||
ASM=i386-elf-as
|
||||
LD=i386-elf-ld
|
||||
UNAME := $(shell uname)
|
||||
|
||||
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=
|
||||
CCFLAGS=-m32 -std=c11 -O2 -g -Wall -Wextra -Wpedantic -Wstrict-aliasing
|
||||
@ -29,16 +37,19 @@ dirs:
|
||||
mkdir -p bin
|
||||
|
||||
clean:
|
||||
rm ./**/*.o
|
||||
rm ./*.iso
|
||||
rm ./**/*.elf
|
||||
rm ./**/*.bin
|
||||
rm -f ./**/*.o
|
||||
rm -f ./*.iso
|
||||
rm -f ./**/*.elf
|
||||
rm -f ./**/*.bin
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -o $@ -c $< $(GFLAGS) $(CCFLAGS)
|
||||
|
||||
%.o: %.S
|
||||
$(ASM) -o $@ -c $< $(GFLAGS) $(ASFLAGS)
|
||||
$(AS) -o $@ -c $< $(GFLAGS) $(ASFLAGS)
|
||||
|
||||
dirs:
|
||||
mkdir -p bin
|
||||
|
||||
bootsect: $(BOOTSECT_OBJS)
|
||||
$(LD) -o ./bin/$(BOOTSECT) $^ -Ttext 0x7C00 --oformat=binary
|
||||
@ -46,7 +57,7 @@ bootsect: $(BOOTSECT_OBJS)
|
||||
kernel: $(KERNEL_OBJS)
|
||||
$(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=./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
|
||||
|
@ -736,6 +736,7 @@ void _main(u32 magic) {
|
||||
render();
|
||||
}
|
||||
|
||||
#ifdef ENABLE_MUSIC
|
||||
if (keyboard_char('m')) {
|
||||
if (!last_music_toggle) {
|
||||
state.music = !state.music;
|
||||
@ -746,6 +747,7 @@ void _main(u32 magic) {
|
||||
} else {
|
||||
last_music_toggle = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
screen_swap();
|
||||
state.frames++;
|
||||
|
Reference in New Issue
Block a user