2018-06-25 11:19:35 +00:00
|
|
|
UNAME_S := $(shell uname -s)
|
|
|
|
|
2018-04-26 12:16:32 +00:00
|
|
|
CFLAGS=-Wall -I../src -ggdb -Og
|
2018-03-26 10:36:47 +00:00
|
|
|
LDFLAGS=-latf-c -lgc
|
2018-06-25 11:19:35 +00:00
|
|
|
|
|
|
|
LDFLAGS_MACOSX=-L/opt/local/lib
|
|
|
|
CFLAGS_MACOSX=-I/opt/local/include -I/opt/local/include/uthash
|
|
|
|
|
|
|
|
ifeq ($(UNAME_S),Darwin)
|
|
|
|
CFLAGS+=$(CFLAGS_MACOSX)
|
|
|
|
LDFLAGS+=$(LDFLAGS_MACOSX)
|
|
|
|
endif
|
|
|
|
|
2017-01-16 22:56:10 +00:00
|
|
|
RK6502LIB=../src/librk65c02.a
|
2017-01-18 22:47:55 +00:00
|
|
|
VASM=vasm6502_std
|
2019-01-04 23:30:18 +00:00
|
|
|
VASMFLAGS=-Fbin -wdc02
|
2017-01-26 12:11:37 +00:00
|
|
|
UTILS=utils.o
|
2017-01-18 22:47:55 +00:00
|
|
|
|
2017-02-26 12:07:39 +00:00
|
|
|
TESTS=test_bus test_emulation test_stepping test_assemble test_interrupt test_debug test_device_serial
|
2017-01-24 11:36:27 +00:00
|
|
|
TESTROMS:=$(addsuffix .rom,$(basename $(wildcard *.s)))
|
2017-01-18 22:47:55 +00:00
|
|
|
|
|
|
|
all : $(TESTS) $(TESTROMS)
|
2017-01-16 21:54:51 +00:00
|
|
|
|
2017-01-26 22:28:04 +00:00
|
|
|
test_stepping : test_stepping.o $(UTILS) $(RK6502LIB)
|
2017-02-06 21:05:16 +00:00
|
|
|
$(CC) -o $@ $(LDFLAGS) $< $(UTILS) $(RK6502LIB)
|
2017-01-26 22:22:40 +00:00
|
|
|
|
2017-01-26 12:11:37 +00:00
|
|
|
test_bus : test_bus.o $(UTILS) $(RK6502LIB)
|
2017-01-26 20:37:54 +00:00
|
|
|
$(CC) -o $@ $(LDFLAGS) $< $(UTILS) $(RK6502LIB)
|
2017-01-18 16:18:19 +00:00
|
|
|
|
2017-01-26 12:11:37 +00:00
|
|
|
test_emulation : test_emulation.o $(UTILS) $(RK6502LIB)
|
2017-01-26 20:37:54 +00:00
|
|
|
$(CC) -o $@ $(LDFLAGS) $< $(UTILS) $(RK6502LIB)
|
2017-01-16 21:54:51 +00:00
|
|
|
|
2017-02-02 13:46:10 +00:00
|
|
|
test_assemble : test_assemble.o $(UTILS) $(RK6502LIB)
|
|
|
|
$(CC) -o $@ $(LDFLAGS) $< $(UTILS) $(RK6502LIB)
|
|
|
|
|
2017-02-07 20:23:31 +00:00
|
|
|
test_interrupt: test_interrupt.o $(UTILS) $(RK6502LIB)
|
|
|
|
$(CC) -o $@ $(LDFLAGS) $< $(UTILS) $(RK6502LIB)
|
2017-02-06 21:05:16 +00:00
|
|
|
|
2017-02-15 18:57:16 +00:00
|
|
|
test_debug: test_debug.o $(UTILS) $(RK6502LIB)
|
|
|
|
$(CC) -o $@ $(LDFLAGS) $< $(UTILS) $(RK6502LIB)
|
|
|
|
|
2017-02-26 12:07:39 +00:00
|
|
|
test_device_serial: test_device_serial.o $(UTILS) $(RK6502LIB)
|
|
|
|
$(CC) -o $@ $(LDFLAGS) $< $(UTILS) $(RK6502LIB)
|
|
|
|
|
2017-01-18 22:47:55 +00:00
|
|
|
%.rom : %.s
|
|
|
|
$(VASM) $(VASMFLAGS) -o $@ $<
|
2017-01-18 16:18:19 +00:00
|
|
|
|
2017-01-16 21:54:51 +00:00
|
|
|
%.o : %.c
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
|
2017-01-18 16:18:19 +00:00
|
|
|
clean :
|
|
|
|
rm -f *.o
|
|
|
|
rm -f $(TESTS)
|
2017-01-18 22:47:55 +00:00
|
|
|
rm -f $(TESTROMS)
|
2017-01-16 21:54:51 +00:00
|
|
|
|