Reorganized test/asm
This commit is contained in:
@@ -1,77 +1,34 @@
|
|||||||
# Makefile for the assembler regression tests
|
# top-level Makefile for the regression tests
|
||||||
|
|
||||||
ifneq ($(shell echo),)
|
ifneq ($(shell echo),)
|
||||||
CMD_EXE = 1
|
CMD_EXE = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CMD_EXE
|
ifdef CMD_EXE
|
||||||
EXE = .exe
|
RMDIR = -rmdir /s /q $(subst /,\,$1)
|
||||||
MKDIR = mkdir $(subst /,\,$1)
|
|
||||||
RMDIR = -rmdir /q /s $(subst /,\,$1)
|
|
||||||
else
|
else
|
||||||
EXE =
|
|
||||||
MKDIR = mkdir -p $1
|
|
||||||
RMDIR = $(RM) -r $1
|
RMDIR = $(RM) -r $1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef QUIET
|
WORKDIR = ../testwrk/asm
|
||||||
.SILENT:
|
|
||||||
endif
|
|
||||||
|
|
||||||
CA65 := $(if $(wildcard ../../bin/ca65*),../../bin/ca65,ca65)
|
SUBDIRS = cpudetect opcodes listing
|
||||||
LD65 := $(if $(wildcard ../../bin/ld65*),../../bin/ld65,ld65)
|
|
||||||
|
|
||||||
WORKDIR = ../../testwrk/asm
|
.PHONY: test continue mostlyclean clean
|
||||||
|
|
||||||
ISEQUAL = ../../testwrk/isequal$(EXE)
|
test: mostlyclean continue
|
||||||
|
|
||||||
CC = gcc
|
define CALL_template
|
||||||
CFLAGS = -O2
|
|
||||||
|
|
||||||
.PHONY: all clean
|
continue::
|
||||||
|
@$(MAKE) -C $1 all
|
||||||
|
|
||||||
OPCODE_REFS := $(wildcard *-opcodes.ref)
|
mostlyclean::
|
||||||
OPCODE_BINS = $(OPCODE_REFS:%.ref=$(WORKDIR)/%.bin)
|
@$(MAKE) -C $1 clean
|
||||||
OPCODE_CPUS = $(OPCODE_REFS:%-opcodes.ref=%)
|
|
||||||
|
|
||||||
CPUDETECT_REFS := $(wildcard *-cpudetect.ref)
|
endef
|
||||||
CPUDETECT_BINS = $(CPUDETECT_REFS:%.ref=$(WORKDIR)/%.bin)
|
|
||||||
CPUDETECT_CPUS = $(CPUDETECT_REFS:%-cpudetect.ref=%)
|
|
||||||
|
|
||||||
all: $(OPCODE_BINS) $(CPUDETECT_BINS) $(WORKDIR)/paramcount.o
|
$(foreach subdir,$(SUBDIRS),$(eval $(call CALL_template,$(subdir))))
|
||||||
|
|
||||||
$(WORKDIR):
|
clean: mostlyclean
|
||||||
$(call MKDIR,$(WORKDIR))
|
|
||||||
|
|
||||||
$(ISEQUAL): ../isequal.c | $(WORKDIR)
|
|
||||||
$(CC) $(CFLAGS) -o $@ $<
|
|
||||||
|
|
||||||
define OPCODE_template
|
|
||||||
|
|
||||||
$(WORKDIR)/$1-opcodes.bin: $1-opcodes.s $(ISEQUAL)
|
|
||||||
$(if $(QUIET),echo asm/$1-opcodes.bin)
|
|
||||||
$(CA65) -t none --cpu $1 -l $$(@:.bin=.lst) -o $$(@:.bin=.o) $$<
|
|
||||||
$(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib
|
|
||||||
$(ISEQUAL) $1-opcodes.ref $$@
|
|
||||||
|
|
||||||
endef # OPCODE_template
|
|
||||||
|
|
||||||
$(foreach cpu,$(OPCODE_CPUS),$(eval $(call OPCODE_template,$(cpu))))
|
|
||||||
|
|
||||||
define CPUDETECT_template
|
|
||||||
|
|
||||||
$(WORKDIR)/$1-cpudetect.bin: cpudetect.s $1-cpudetect.ref $(ISEQUAL)
|
|
||||||
$(if $(QUIET),echo asm/$1-cpudetect.bin)
|
|
||||||
$(CA65) -t none --cpu $1 -l $$(@:.bin=.lst) -o $$(@:.bin=.o) $$<
|
|
||||||
$(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib
|
|
||||||
$(ISEQUAL) $1-cpudetect.ref $$@
|
|
||||||
|
|
||||||
endef # CPUDETECT_template
|
|
||||||
|
|
||||||
$(foreach cpu,$(CPUDETECT_CPUS),$(eval $(call CPUDETECT_template,$(cpu))))
|
|
||||||
|
|
||||||
$(WORKDIR)/%.o: %.s | $(WORKDIR)
|
|
||||||
$(CA65) -l $(@:.o=.lst) -o $@ $<
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@$(call RMDIR,$(WORKDIR))
|
@$(call RMDIR,$(WORKDIR))
|
||||||
|
|||||||
61
test/asm/cpudetect/Makefile
Normal file
61
test/asm/cpudetect/Makefile
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
# Makefile for the assembler regression tests
|
||||||
|
|
||||||
|
ifneq ($(shell echo),)
|
||||||
|
CMD_EXE = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef CMD_EXE
|
||||||
|
EXE = .exe
|
||||||
|
MKDIR = mkdir $(subst /,\,$1)
|
||||||
|
RMDIR = -rmdir /q /s $(subst /,\,$1)
|
||||||
|
else
|
||||||
|
EXE =
|
||||||
|
MKDIR = mkdir -p $1
|
||||||
|
RMDIR = $(RM) -r $1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef QUIET
|
||||||
|
.SILENT:
|
||||||
|
endif
|
||||||
|
|
||||||
|
CA65 := $(if $(wildcard ../../../bin/ca65*),../../../bin/ca65,ca65)
|
||||||
|
LD65 := $(if $(wildcard ../../../bin/ld65*),../../../bin/ld65,ld65)
|
||||||
|
|
||||||
|
WORKDIR = ../../../testwrk/asm/cpudetect
|
||||||
|
|
||||||
|
ISEQUAL = ../../../testwrk/isequal$(EXE)
|
||||||
|
|
||||||
|
CC = gcc
|
||||||
|
CFLAGS = -O2
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
|
CPUDETECT_REFS := $(wildcard *-cpudetect.ref)
|
||||||
|
CPUDETECT_BINS = $(CPUDETECT_REFS:%.ref=$(WORKDIR)/%.bin)
|
||||||
|
CPUDETECT_CPUS = $(CPUDETECT_REFS:%-cpudetect.ref=%)
|
||||||
|
|
||||||
|
all: $(CPUDETECT_BINS)
|
||||||
|
|
||||||
|
$(WORKDIR):
|
||||||
|
$(call MKDIR,$(WORKDIR))
|
||||||
|
|
||||||
|
$(ISEQUAL): ../../isequal.c | $(WORKDIR)
|
||||||
|
$(CC) $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
define CPUDETECT_template
|
||||||
|
|
||||||
|
$(WORKDIR)/$1-cpudetect.bin: cpudetect.s $1-cpudetect.ref $(ISEQUAL)
|
||||||
|
$(if $(QUIET),echo asm/$1-cpudetect.bin)
|
||||||
|
$(CA65) -t none --cpu $1 -l $$(@:.bin=.lst) -o $$(@:.bin=.o) $$<
|
||||||
|
$(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib
|
||||||
|
$(ISEQUAL) $1-cpudetect.ref $$@
|
||||||
|
|
||||||
|
endef # CPUDETECT_template
|
||||||
|
|
||||||
|
$(foreach cpu,$(CPUDETECT_CPUS),$(eval $(call CPUDETECT_template,$(cpu))))
|
||||||
|
|
||||||
|
$(WORKDIR)/%.o: %.s | $(WORKDIR)
|
||||||
|
$(CA65) -l $(@:.o=.lst) -o $@ $<
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@$(call RMDIR,$(WORKDIR))
|
||||||
89
test/asm/listing/Makefile
Normal file
89
test/asm/listing/Makefile
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
# Makefile for the assembler regression tests
|
||||||
|
|
||||||
|
ifneq ($(shell echo),)
|
||||||
|
CMD_EXE = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef CMD_EXE
|
||||||
|
EXE = .exe
|
||||||
|
MKDIR = mkdir $(subst /,\,$1)
|
||||||
|
RMDIR = -rmdir /q /s $(subst /,\,$1)
|
||||||
|
else
|
||||||
|
EXE =
|
||||||
|
MKDIR = mkdir -p $1
|
||||||
|
RMDIR = $(RM) -r $1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef QUIET
|
||||||
|
.SILENT:
|
||||||
|
endif
|
||||||
|
|
||||||
|
CA65 := $(if $(wildcard ../../../bin/ca65*),../../../bin/ca65,ca65)
|
||||||
|
LD65 := $(if $(wildcard ../../../bin/ld65*),../../../bin/ld65,ld65)
|
||||||
|
|
||||||
|
WORKDIR = ../../../testwrk/asm/listing
|
||||||
|
|
||||||
|
ISEQUAL = ../../../testwrk/isequal$(EXE)
|
||||||
|
|
||||||
|
CC = gcc
|
||||||
|
CFLAGS = -O2
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
|
LISTING_SRC := $(wildcard *.s)
|
||||||
|
LISTING_TESTS = $(LISTING_SRC:%.s=%)
|
||||||
|
LISTING_BINS = $(LISTING_SRC:%.s=$(WORKDIR)/%.bin)
|
||||||
|
|
||||||
|
all: $(LISTING_BINS)
|
||||||
|
|
||||||
|
$(WORKDIR):
|
||||||
|
$(call MKDIR,$(WORKDIR))
|
||||||
|
|
||||||
|
$(ISEQUAL): ../../isequal.c | $(WORKDIR)
|
||||||
|
$(CC) $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
|
||||||
|
define LISTING_template
|
||||||
|
|
||||||
|
$(WORKDIR)/$1.bin: $1.s $(ISEQUAL)
|
||||||
|
$(if $(QUIET),echo asm/$1.bin)
|
||||||
|
|
||||||
|
# compile without generating listing
|
||||||
|
$(CA65) -t none -o $$(@:.bin=.o) $$<
|
||||||
|
$(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib
|
||||||
|
|
||||||
|
ifneq ($(wildcard $1.bin-ref),)
|
||||||
|
$(ISEQUAL) $1.bin-ref $$@
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(CA65) -t none -l $$(@:.bin=.list.orig) -o $$(@:.bin=.list-o) $$<
|
||||||
|
$(LD65) -t none -o $$(@:.bin=.list-bin) $$(@:.bin=.list-o) none.lib
|
||||||
|
|
||||||
|
# check if the result bin is the same as without listing file
|
||||||
|
$(ISEQUAL) $$@ $$(@:.bin=.list-bin)
|
||||||
|
|
||||||
|
ifneq ($(wildcard $1.list-ref),)
|
||||||
|
# we have a reference file, compare that, too
|
||||||
|
|
||||||
|
# remove first line which contains a version number
|
||||||
|
tail -n +2 $$(@:.bin=.lst.orig) > $$(@:.bin=.lst)
|
||||||
|
$(ISEQUAL) $1.list-ref $$(@:.bin=.lst)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# $(CA65) -t none -f -l $$(@:.bin=.flist.orig) -o $$(@:.bin=.flist-o) $$<
|
||||||
|
# $(LD65) -t none -o $$(@:.bin=.flist-bin) $$(@:.bin=.flist-o) none.lib
|
||||||
|
|
||||||
|
# # check if the result bin is the same as without listing file
|
||||||
|
# $(ISEQUAL) $$@ $$(@:.bin=.flist-bin)
|
||||||
|
|
||||||
|
endef # LISTING_template
|
||||||
|
|
||||||
|
|
||||||
|
$(foreach listing,$(LISTING_TESTS),$(eval $(call LISTING_template,$(listing))))
|
||||||
|
|
||||||
|
|
||||||
|
$(WORKDIR)/%.o: %.s | $(WORKDIR)
|
||||||
|
$(CA65) -l $(@:.o=.lst) -o $@ $<
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@$(call RMDIR,$(WORKDIR))
|
||||||
61
test/asm/opcodes/Makefile
Normal file
61
test/asm/opcodes/Makefile
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
# Makefile for the assembler regression tests
|
||||||
|
|
||||||
|
ifneq ($(shell echo),)
|
||||||
|
CMD_EXE = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef CMD_EXE
|
||||||
|
EXE = .exe
|
||||||
|
MKDIR = mkdir $(subst /,\,$1)
|
||||||
|
RMDIR = -rmdir /q /s $(subst /,\,$1)
|
||||||
|
else
|
||||||
|
EXE =
|
||||||
|
MKDIR = mkdir -p $1
|
||||||
|
RMDIR = $(RM) -r $1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef QUIET
|
||||||
|
.SILENT:
|
||||||
|
endif
|
||||||
|
|
||||||
|
CA65 := $(if $(wildcard ../../../bin/ca65*),../../../bin/ca65,ca65)
|
||||||
|
LD65 := $(if $(wildcard ../../../bin/ld65*),../../../bin/ld65,ld65)
|
||||||
|
|
||||||
|
WORKDIR = ../../../testwrk/asm/opcodes
|
||||||
|
|
||||||
|
ISEQUAL = ../../../testwrk/isequal$(EXE)
|
||||||
|
|
||||||
|
CC = gcc
|
||||||
|
CFLAGS = -O2
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
|
OPCODE_REFS := $(wildcard *-opcodes.ref)
|
||||||
|
OPCODE_BINS = $(OPCODE_REFS:%.ref=$(WORKDIR)/%.bin)
|
||||||
|
OPCODE_CPUS = $(OPCODE_REFS:%-opcodes.ref=%)
|
||||||
|
|
||||||
|
all: $(OPCODE_BINS)
|
||||||
|
|
||||||
|
$(WORKDIR):
|
||||||
|
$(call MKDIR,$(WORKDIR))
|
||||||
|
|
||||||
|
$(ISEQUAL): ../../isequal.c | $(WORKDIR)
|
||||||
|
$(CC) $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
define OPCODE_template
|
||||||
|
|
||||||
|
$(WORKDIR)/$1-opcodes.bin: $1-opcodes.s $(ISEQUAL)
|
||||||
|
$(if $(QUIET),echo asm/$1-opcodes.bin)
|
||||||
|
$(CA65) -t none --cpu $1 -l $$(@:.bin=.lst) -o $$(@:.bin=.o) $$<
|
||||||
|
$(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib
|
||||||
|
$(ISEQUAL) $1-opcodes.ref $$@
|
||||||
|
|
||||||
|
endef # OPCODE_template
|
||||||
|
|
||||||
|
$(foreach cpu,$(OPCODE_CPUS),$(eval $(call OPCODE_template,$(cpu))))
|
||||||
|
|
||||||
|
$(WORKDIR)/%.o: %.s | $(WORKDIR)
|
||||||
|
$(CA65) -l $(@:.o=.lst) -o $@ $<
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@$(call RMDIR,$(WORKDIR))
|
||||||
Reference in New Issue
Block a user