2024-03-19 22:37:03 +01:00
|
|
|
PRJ=Emu48gcc
|
|
|
|
|
|
|
|
CC=gcc
|
|
|
|
LD=gcc
|
|
|
|
|
|
|
|
# This is to make GCC not bitch at things M$ allows
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
CFLAGS= -x c -O3 -Wall -Wno-missing-braces -Wno-format -Wno-uninitialized \
|
|
|
|
-Wno-strict-aliasing -Wno-unused-function -Wno-unknown-pragmas
|
2024-03-19 22:37:03 +01:00
|
|
|
|
2024-03-19 23:35:29 +01:00
|
|
|
DEFINES= -DIDC_STATIC=-1 \
|
|
|
|
-DREGISTRY
|
2024-03-19 22:37:03 +01:00
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
LODEPNGDEFINES= -DLODEPNG_NO_COMPILE_ENCODER \
|
|
|
|
-DLODEPNG_NO_COMPILE_DISK \
|
2024-03-19 23:35:30 +01:00
|
|
|
-DLODEPNG_NO_COMPILE_ANCILLARY_CHUNKS \
|
2024-03-19 23:35:30 +01:00
|
|
|
-DLODEPNG_NO_COMPILE_ERROR_TEXT \
|
2024-03-19 23:35:31 +01:00
|
|
|
-DLODEPNG_NO_COMPILE_CPP \
|
|
|
|
-DLODEPNG_NO_COMPILE_CRC
|
2024-03-19 23:35:30 +01:00
|
|
|
|
2024-03-19 22:37:03 +01:00
|
|
|
LDFLAGS= -s -mwindows
|
|
|
|
|
|
|
|
TARGET=$(PRJ).exe
|
|
|
|
|
|
|
|
#
|
|
|
|
# Warning.. my own resources because WINDRES doesn't understand
|
|
|
|
# the FONT definition for dialogs produced by the M$ tools
|
|
|
|
#
|
|
|
|
RSRC=$(PRJ).rc
|
|
|
|
RSRCOBJ=$(PRJ).o
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
OBJS=cursor.o ddeserv.o debugger.o disasm.o dismem.o display.o disrpl.o \
|
2024-03-19 23:35:30 +01:00
|
|
|
emu48.o engine.o fetch.o files.o i28f160.o keyboard.o \
|
2024-03-19 23:35:30 +01:00
|
|
|
keymacro.o kml.o lodepng.o lowbat.o mru.o mops.o opcodes.o \
|
2024-03-19 23:35:31 +01:00
|
|
|
pngcrc.o redeye.o romcrc.o rpl.o serial.o settings.o sndenum.o \
|
|
|
|
sound.o stack.o symbfile.o timer.o udp.o \
|
2024-03-19 22:37:03 +01:00
|
|
|
$(RSRCOBJ)
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
LIBS=-lwinmm -lcomctl32 -lws2_32 -luuid
|
2024-03-19 22:37:03 +01:00
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
rebuild: tidy $(TARGET)
|
|
|
|
|
|
|
|
tidy: cleanemacs cleanobj cleanexe
|
|
|
|
|
|
|
|
cleanemacs:
|
|
|
|
-rm -f *~
|
|
|
|
|
|
|
|
cleanobj:
|
|
|
|
-rm -f $(OBJS)
|
|
|
|
|
|
|
|
cleanexe:
|
|
|
|
-rm -f $(TARGET)
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
cursor.o: cursor.c pch.h emu48.h types.h
|
2024-03-19 22:38:33 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o cursor.o cursor.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
ddeserv.o: ddeserv.c pch.h emu48.h types.h io.h
|
2024-03-19 22:37:03 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o ddeserv.o ddeserv.c
|
|
|
|
|
|
|
|
debugger.o: debugger.c pch.h resource.h emu48.h \
|
2024-03-19 23:35:29 +01:00
|
|
|
types.h opcodes.h ops.h color.h disrpl.h debugger.h
|
2024-03-19 22:37:03 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o debugger.o debugger.c
|
|
|
|
|
|
|
|
disasm.o: disasm.c pch.h emu48.h types.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o disasm.o disasm.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
dismem.o: dismem.c pch.h emu48.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o dismem.o dismem.c
|
|
|
|
|
2024-03-19 22:37:03 +01:00
|
|
|
display.o: display.c pch.h resource.h emu48.h \
|
|
|
|
types.h io.h kml.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o display.o display.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
disrpl.o: disrpl.c pch.h Emu48.h types.h disrpl.h
|
2024-03-19 23:35:29 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o disrpl.o disrpl.c
|
|
|
|
|
2024-03-19 23:35:29 +01:00
|
|
|
emu48.o: emu48.c pch.h resource.h emu48.h types.h \
|
2024-03-19 22:37:03 +01:00
|
|
|
io.h kml.h debugger.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o emu48.o emu48.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
engine.o: engine.c pch.h emu48.h types.h opcodes.h \
|
|
|
|
io.h debugger.h
|
2024-03-19 22:37:03 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o engine.o engine.c
|
|
|
|
|
|
|
|
fetch.o: fetch.c pch.h opcodes.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o fetch.o fetch.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
files.o: files.c pch.h emu48.h types.h ops.h io.h \
|
2024-03-19 22:37:03 +01:00
|
|
|
kml.h i28f160.h debugger.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o files.o files.c
|
|
|
|
|
|
|
|
i28f160.o: i28f160.c pch.h emu48.h types.h i28f160.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o i28f160.o i28f160.c
|
|
|
|
|
|
|
|
keyboard.o: keyboard.c pch.h emu48.h types.h io.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o keyboard.o keyboard.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
keymacro.o: keymacro.c pch.h resource.h Emu48.h types.h kml.h
|
2024-03-19 23:33:35 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o keymacro.o keymacro.c
|
|
|
|
|
2024-03-19 22:37:03 +01:00
|
|
|
kml.o: kml.c pch.h resource.h emu48.h types.h kml.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o kml.o kml.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
lodepng.o: lodepng.c lodepng.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) $(LODEPNGDEFINES) -c -o lodepng.o lodepng.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
lowbat.o: lowbat.c pch.h emu48.h types.h io.h
|
2024-03-19 23:35:29 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o lowbat.o lowbat.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
mops.o: mops.c pch.h emu48.h types.h ops.h opcodes.h io.h \
|
2024-03-19 22:37:03 +01:00
|
|
|
i28f160.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o mops.o mops.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
mru.o: mru.c pch.h resource.h emu48.h types.h
|
2024-03-19 23:35:29 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o mru.o mru.c
|
|
|
|
|
2024-03-19 22:37:03 +01:00
|
|
|
opcodes.o: opcodes.c pch.h emu48.h types.h opcodes.h \
|
2024-03-19 23:35:30 +01:00
|
|
|
io.h
|
2024-03-19 22:37:03 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o opcodes.o opcodes.c
|
|
|
|
|
|
|
|
# pch.o: pch.c pch.h
|
|
|
|
# $(CC) $(CFLAGS) $(DEFINES) -c -o pch.o pch.c
|
|
|
|
|
2024-03-19 23:35:31 +01:00
|
|
|
pngcrc.o: pngcrc.c pch.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o pngcrc.o pngcrc.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
redeye.o: redeye.c pch.h emu48.h types.h io.h
|
2024-03-19 23:35:30 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o redeye.o redeye.c
|
|
|
|
|
2024-03-19 23:35:31 +01:00
|
|
|
romcrc.o: romcrc.c pch.h emu48.h ops.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o romcrc.o romcrc.c
|
|
|
|
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
rpl.o: rpl.c pch.h emu48.h types.h ops.h io.h
|
2024-03-19 22:37:03 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o rpl.o rpl.c
|
|
|
|
|
|
|
|
serial.o: serial.c pch.h emu48.h types.h io.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o serial.o serial.c
|
|
|
|
|
|
|
|
settings.o: settings.c pch.h emu48.h types.h i28f160.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o settings.o settings.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
sndenum.o: sndenum.c pch.h emu48.h snddef.h
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o sndenum.o sndenum.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
sound.o: sound.c pch.h emu48.h types.h
|
2024-03-19 23:35:30 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o sound.o sound.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
stack.o: stack.c pch.h emu48.h types.h io.h
|
2024-03-19 23:35:29 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o stack.o stack.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
symbfile.o: symbfile.c pch.h emu48.h types.h
|
2024-03-19 23:35:29 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o symbfile.o symbfile.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
timer.o: timer.c pch.h emu48.h types.h ops.h io.h
|
2024-03-19 22:37:03 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o timer.o timer.c
|
|
|
|
|
2024-03-19 23:35:30 +01:00
|
|
|
udp.o: udp.c pch.h emu48.h types.h
|
2024-03-19 23:35:30 +01:00
|
|
|
$(CC) $(CFLAGS) $(DEFINES) -c -o udp.o udp.c
|
|
|
|
|
2024-03-19 22:38:33 +01:00
|
|
|
$(RSRCOBJ): $(RSRC) resource.h emu48.ico dbgtool.bmp checkbox.bmp Emu48.xml
|
2024-03-19 22:37:03 +01:00
|
|
|
windres $(DEFINES) -i $(RSRC) -o $(RSRCOBJ)
|
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
|
|
|
$(LD) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
|