2024-02-04 17:07:19 +01:00
|
|
|
SDL2_CONFIG ?= sdl2-config
|
|
|
|
FOX32ROM_IN ?= fox32.rom
|
|
|
|
|
|
|
|
FOX32ROM_OUT = fox32rom.h
|
2023-02-22 09:59:59 +01:00
|
|
|
CFLAGS += -g -Ofast -std=c99 -Wall -Wextra `$(SDL2_CONFIG) --cflags`
|
|
|
|
LDFLAGS += `$(SDL2_CONFIG) --libs`
|
2022-10-23 03:00:51 +02:00
|
|
|
|
|
|
|
CFILES = src/main.c \
|
2022-10-23 22:16:40 +02:00
|
|
|
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 \
|
2022-10-25 02:48:51 +02:00
|
|
|
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
|
|
|
|
2023-02-22 09:59:59 +01:00
|
|
|
OBJS = $(addsuffix .o, $(basename $(CFILES)))
|
|
|
|
|
|
|
|
.PHONY: all
|
2024-02-04 17:07:19 +01:00
|
|
|
all: fox32
|
2022-10-27 03:09:36 +02:00
|
|
|
|
2023-02-22 09:59:59 +01:00
|
|
|
$(FOX32ROM_OUT): $(FOX32ROM_IN)
|
2024-02-04 17:07:19 +01:00
|
|
|
cp $(FOX32ROM_IN) fox32.rom
|
|
|
|
xxd -i fox32.rom $(FOX32ROM_OUT)
|
|
|
|
rm -f fox32.rom
|
2023-02-22 09:59:59 +01:00
|
|
|
sed -i -e 's/fox32_rom/fox32rom/' $(FOX32ROM_OUT)
|
2022-10-23 03:00:51 +02:00
|
|
|
|
2024-02-04 17:07:19 +01:00
|
|
|
fox32: $(OBJS)
|
2023-02-22 09:59:59 +01:00
|
|
|
$(CC) -o $@ $(OBJS) $(LDFLAGS)
|
2022-12-27 02:22:48 +01:00
|
|
|
|
2023-02-22 09:59:59 +01:00
|
|
|
%.o: %.c $(FOX32ROM_OUT)
|
|
|
|
$(CC) -o $@ -c $< $(CFLAGS)
|
2023-02-13 10:00:06 +01:00
|
|
|
|
2022-10-23 03:00:51 +02:00
|
|
|
clean:
|
2024-02-04 17:07:19 +01:00
|
|
|
rm -rf fox32 $(FOX32ROM_OUT) $(OBJS)
|