fox32/Makefile

42 lines
1.2 KiB
Makefile
Raw Normal View History

2022-10-23 03:00:51 +02:00
SDL2_CONFIG = sdl2-config
CFLAGS = -g -Ofast -std=c99 -Wall -Wextra `$(SDL2_CONFIG) --cflags --libs`
CC_WIN = x86_64-w64-mingw32-gcc
CFLAGS_WIN = -g -Ofast -std=c99 -Wall -Wextra -lmingw32 -lSDL2main -lSDL2
2023-02-13 10:00:06 +01:00
CC_WASM = emcc
CFLAGS_WASM = -O3 -std=c99 -Wall -Wextra -s TOTAL_MEMORY=70057984 -sALLOW_MEMORY_GROWTH=1 -sUSE_SDL=2 --preload-file fox32os.img
2022-10-23 03:00:51 +02:00
TARGET=fox32
TARGET_WIN=fox32.exe
2023-02-13 10:00:06 +01:00
TARGET_WASM=fox32.html
2022-10-23 03:00:51 +02:00
CFILES = src/main.c \
src/bus.c \
2022-10-23 03:00:51 +02:00
src/cpu.c \
2022-10-24 07:36:24 +02:00
src/disk.c \
2022-10-23 03:00:51 +02:00
src/framebuffer.c \
src/keyboard.c \
2022-10-26 07:44:18 +02:00
src/mmu.c \
2022-10-24 02:18:05 +02:00
src/mouse.c \
2023-02-01 20:12:21 +01:00
src/screen.c \
src/serial.c
2022-10-23 03:00:51 +02:00
2022-10-27 03:09:36 +02:00
FOX32ROM_IN = fox32.rom
FOX32ROM_OUT = fox32rom.h
$(TARGET): $(CFILES) $(FOX32ROM_IN)
2022-10-27 03:21:40 +02:00
xxd -i $(FOX32ROM_IN) $(FOX32ROM_OUT)
sed -i -e 's/fox32_rom/fox32rom/' fox32rom.h
2022-10-23 03:00:51 +02:00
$(CC) -o $@ $(filter %.c, $^) $(CFLAGS)
$(TARGET_WIN): $(CFILES)
xxd -i $(FOX32ROM_IN) $(FOX32ROM_OUT)
sed -i -e 's/fox32_rom/fox32rom/' fox32rom.h
$(CC_WIN) -o $@ $(filter %.c, $^) $(CFLAGS_WIN)
2023-02-13 10:00:06 +01:00
$(TARGET_WASM): $(CFILES) $(FOX32ROM_IN)
xxd -i $(FOX32ROM_IN) $(FOX32ROM_OUT)
sed -i -e 's/fox32_rom/fox32rom/' fox32rom.h
$(CC_WASM) -o $@ $(filter %.c, $^) $(CFLAGS_WASM)
2022-10-23 03:00:51 +02:00
clean:
2023-02-13 10:00:06 +01:00
rm -rf $(TARGET) $(TARGET_WIN) $(TARGET_WASM)