2016-09-03 16:45:59 +02:00
|
|
|
|
|
|
|
# makefile for the assembler regression tests
|
|
|
|
|
|
|
|
BINDIR = ../../bin
|
2016-09-13 11:28:11 +02:00
|
|
|
WORKDIR := ../../testwrk
|
2016-09-03 16:45:59 +02:00
|
|
|
|
2016-09-07 19:21:24 +02:00
|
|
|
BASE_TARGETS = 6502 6502x 65sc02 65c02
|
|
|
|
BASE_TARGETS += 4510 huc6280
|
2016-09-03 16:45:59 +02:00
|
|
|
|
2016-09-07 19:21:24 +02:00
|
|
|
OPCODE_TARGETS = $(BASE_TARGETS)
|
|
|
|
CPUDETECT_TARGETS = $(BASE_TARGETS)
|
2016-09-03 16:45:59 +02:00
|
|
|
|
2016-09-07 19:21:24 +02:00
|
|
|
CPUDETECT_TARGETS += 65816
|
2016-09-03 16:45:59 +02:00
|
|
|
|
2016-09-07 19:21:24 +02:00
|
|
|
# default target defined later
|
|
|
|
all:
|
2016-09-03 16:45:59 +02:00
|
|
|
|
2016-09-07 19:21:24 +02:00
|
|
|
# generate opcode targets and expand target list
|
|
|
|
define opcode
|
2016-09-13 11:28:11 +02:00
|
|
|
OPCODE_TARGETLIST += $$(WORKDIR)/$(1)-opcodes.bin
|
2016-09-13 11:21:25 +02:00
|
|
|
$$(WORKDIR)/$(1)-opcodes.bin: $(1)-opcodes.s
|
|
|
|
@$$(BINDIR)/cl65 --cpu $(1) -t none -l $$(WORKDIR)/$(1)-opcodes.lst --obj-path $$(WORKDIR) -o $$@ $$<
|
|
|
|
@diff -q $(1)-opcodes.ref $$@ || (cat $$(WORKDIR)/$(1)-opcodes.lst ; exit 1)
|
2016-09-07 19:21:24 +02:00
|
|
|
@echo ca65 --cpu $(1) opcodes ok
|
2016-09-13 11:28:11 +02:00
|
|
|
@rm -f $(1)-opcodes.o #workaround for #168
|
2016-09-03 16:45:59 +02:00
|
|
|
endef
|
2016-09-07 19:21:24 +02:00
|
|
|
$(foreach target,$(OPCODE_TARGETS),$(eval $(call opcode,$(target))))
|
|
|
|
|
|
|
|
# generate cpudetect targets and expand target list
|
|
|
|
define cpudetect
|
2016-09-13 11:28:11 +02:00
|
|
|
CPUDETECT_TARGETLIST += $$(WORKDIR)/$(1)-cpudetect.bin
|
2016-09-13 11:21:25 +02:00
|
|
|
$$(WORKDIR)/$(1)-cpudetect.bin: cpudetect.s
|
|
|
|
@$$(BINDIR)/cl65 --cpu $(1) -t none -l $$(WORKDIR)/$(1)-cpudetect.lst --obj-path $$(WORKDIR) -o $$@ $$<
|
|
|
|
@diff -q $(1)-cpudetect.ref $$@ || (cat $$(WORKDIR)/$(1)-cpudetect.lst ; exit 1)
|
2016-09-07 19:21:24 +02:00
|
|
|
@echo ca65 --cpu $(1) cpudetect ok
|
2016-09-13 11:28:11 +02:00
|
|
|
@rm -f cpudetect.o #workaround for #168
|
2016-09-07 19:21:24 +02:00
|
|
|
endef
|
|
|
|
$(foreach target,$(CPUDETECT_TARGETS),$(eval $(call cpudetect,$(target))))
|
|
|
|
|
|
|
|
# now that all targets have been generated, get to the manual ones
|
|
|
|
all: $(OPCODE_TARGETLIST) $(CPUDETECT_TARGETLIST)
|
|
|
|
@#
|
|
|
|
|
2016-09-13 11:28:11 +02:00
|
|
|
.PHONY: all $(OPCODE_TARGETLIST) $(CPUDETECT_TARGETLIST)
|
2016-09-03 16:45:59 +02:00
|
|
|
|