2022-03-22 13:47:02 +01:00
|
|
|
CC = gcc
|
2023-05-11 16:58:52 +02:00
|
|
|
LIBS = $(shell pkg-config --libs sdl2 SDL2_ttf)
|
2022-03-22 14:30:58 +01:00
|
|
|
CFLAGS = -Wall -Werror -O3 -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=missing-braces -Wno-error=incompatible-pointer-types
|
2022-03-22 13:47:02 +01:00
|
|
|
|
2023-10-03 13:24:52 +02:00
|
|
|
.PHONY: all clean clean-all pretty-code install mrproper
|
2022-03-22 13:47:02 +01:00
|
|
|
|
2023-05-11 16:43:32 +02:00
|
|
|
all: dist/hpemu
|
2022-03-22 13:47:02 +01:00
|
|
|
|
2023-05-11 16:43:32 +02:00
|
|
|
dist/hpemu: src/bus.o \
|
|
|
|
src/color.o \
|
|
|
|
src/cpu.o \
|
|
|
|
src/display.o \
|
|
|
|
src/emulator.o \
|
|
|
|
src/gui.o \
|
|
|
|
src/hdw.o \
|
|
|
|
src/keyboard.o \
|
|
|
|
src/main.o \
|
|
|
|
src/opcodes.o \
|
|
|
|
src/pcalc.o \
|
|
|
|
src/pfiles.o \
|
|
|
|
src/ports.o \
|
|
|
|
src/ram.o \
|
|
|
|
src/rom.o \
|
|
|
|
src/rpl.o \
|
|
|
|
src/timers.o
|
|
|
|
$(CC) $(CFLAGS) $(LIBS) -o $@ $+
|
|
|
|
|
2024-03-20 21:04:48 +01:00
|
|
|
# Installing
|
|
|
|
ROMs/sxrom-a:
|
|
|
|
curl "https://www.hpcalc.org/hp48/pc/emulators/sxrom-a.zip" --output - | funzip > "ROMs/sxrom-a"
|
|
|
|
ROMs/sxrom-b:
|
|
|
|
curl "https://www.hpcalc.org/hp48/pc/emulators/sxrom-b.zip" --output - | funzip > "ROMs/sxrom-b"
|
|
|
|
ROMs/sxrom-c:
|
|
|
|
curl "https://www.hpcalc.org/hp48/pc/emulators/sxrom-c.zip" --output - | funzip > "ROMs/sxrom-c"
|
|
|
|
ROMs/sxrom-d:
|
|
|
|
curl "https://www.hpcalc.org/hp48/pc/emulators/sxrom-d.zip" --output - | funzip > "ROMs/sxrom-d"
|
|
|
|
ROMs/sxrom-e:
|
|
|
|
curl "https://www.hpcalc.org/hp48/pc/emulators/sxrom-e.zip" --output - | funzip > "ROMs/sxrom-e"
|
|
|
|
ROMs/sxrom-j:
|
|
|
|
curl "https://www.hpcalc.org/hp48/pc/emulators/sxrom-j.zip" --output - | funzip > "ROMs/sxrom-j"
|
|
|
|
ROMs/gxrom-l:
|
|
|
|
curl "https://www.hpcalc.org/hp48/pc/emulators/gxrom-l.zip" --output - | funzip > "ROMs/gxrom-l"
|
|
|
|
ROMs/gxrom-m:
|
|
|
|
curl "https://www.hpcalc.org/hp48/pc/emulators/gxrom-m.zip" --output - | funzip > "ROMs/gxrom-m"
|
|
|
|
ROMs/gxrom-p:
|
|
|
|
curl "https://www.hpcalc.org/hp48/pc/emulators/gxrom-p.zip" --output - | funzip > "ROMs/gxrom-p"
|
|
|
|
ROMs/gxrom-r:
|
|
|
|
curl "https://www.hpcalc.org/hp48/pc/emulators/gxrom-r.zip" --output - | funzip > "ROMs/gxrom-r"
|
|
|
|
|
|
|
|
get-roms: ROMs/sxrom-a ROMs/sxrom-b ROMs/sxrom-c ROMs/sxrom-d ROMs/sxrom-e ROMs/sxrom-j ROMs/gxrom-l ROMs/gxrom-m ROMs/gxrom-p ROMs/gxrom-r
|
|
|
|
|
2023-05-11 16:43:32 +02:00
|
|
|
# Cleaning
|
|
|
|
clean:
|
|
|
|
-rm src/*.o
|
2022-03-22 13:47:02 +01:00
|
|
|
|
2023-10-03 13:24:52 +02:00
|
|
|
mrproper: clean
|
2023-05-11 16:43:32 +02:00
|
|
|
-rm dist/hpemu
|
2022-03-22 13:47:02 +01:00
|
|
|
|
2023-10-03 13:24:52 +02:00
|
|
|
clean-all: mrproper
|
|
|
|
|
2023-05-11 16:43:32 +02:00
|
|
|
# Formatting
|
|
|
|
pretty-code:
|
|
|
|
clang-format -i src/*.c src/*.h
|