|
|
|
@@ -5,25 +5,33 @@ ifneq ($(shell echo),)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ifdef CMD_EXE
|
|
|
|
ifdef CMD_EXE
|
|
|
|
|
|
|
|
S = $(subst /,\,/)
|
|
|
|
EXE = .exe
|
|
|
|
EXE = .exe
|
|
|
|
MKDIR = mkdir $(subst /,\,$1)
|
|
|
|
MKDIR = mkdir $(subst /,\,$1)
|
|
|
|
RMDIR = -rmdir /q /s $(subst /,\,$1)
|
|
|
|
RMDIR = -rmdir /q /s $(subst /,\,$1)
|
|
|
|
|
|
|
|
ERRDIR = 2>&1
|
|
|
|
|
|
|
|
TRUE = exit 0
|
|
|
|
|
|
|
|
CAT = type $(subst /,\,$1)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
S = /
|
|
|
|
EXE =
|
|
|
|
EXE =
|
|
|
|
MKDIR = mkdir -p $1
|
|
|
|
MKDIR = mkdir -p $1
|
|
|
|
RMDIR = $(RM) -r $1
|
|
|
|
RMDIR = $(RM) -r $1
|
|
|
|
|
|
|
|
ERRDIR = 2>&1
|
|
|
|
|
|
|
|
TRUE = true
|
|
|
|
|
|
|
|
CAT = cat
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ifdef QUIET
|
|
|
|
ifdef QUIET
|
|
|
|
# .SILENT:
|
|
|
|
# .SILENT:
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
CA65 := $(if $(wildcard ../../../bin/ca65*),../../../bin/ca65,ca65)
|
|
|
|
CA65 := $(if $(wildcard ../../../bin/ca65*),..$S..$S..$Sbin$Sca65,ca65)
|
|
|
|
LD65 := $(if $(wildcard ../../../bin/ld65*),../../../bin/ld65,ld65)
|
|
|
|
LD65 := $(if $(wildcard ../../../bin/ld65*),..$S..$S..$Sbin$Sld65,ld65)
|
|
|
|
|
|
|
|
|
|
|
|
WORKDIR = ../../../testwrk/asm/listing
|
|
|
|
WORKDIR = ../../../testwrk/asm/listing
|
|
|
|
|
|
|
|
|
|
|
|
ISEQUAL = ../../../testwrk/isequal$(EXE)
|
|
|
|
ISEQUAL = ..$S..$S..$Stestwrk$Sisequal$(EXE)
|
|
|
|
|
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
CC = gcc
|
|
|
|
CFLAGS = -O2
|
|
|
|
CFLAGS = -O2
|
|
|
|
@@ -50,14 +58,14 @@ $(WORKDIR)/$1.bin: $1.s $(ISEQUAL)
|
|
|
|
|
|
|
|
|
|
|
|
# compile without generating listing
|
|
|
|
# compile without generating listing
|
|
|
|
ifeq ($(wildcard control/$1.err),)
|
|
|
|
ifeq ($(wildcard control/$1.err),)
|
|
|
|
$(CA65) -t none -o $$(@:.bin=.o) $$< > $$(@:.bin=.err) 2>&1
|
|
|
|
$(CA65) -t none -o $$(@:.bin=.o) $$< > $$(@:.bin=.err) $(ERRDIR)
|
|
|
|
ifeq ($(wildcard control/$1.no-ld65),)
|
|
|
|
ifeq ($(wildcard control/$1.no-ld65),)
|
|
|
|
$(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib > $$(@:.bin=.ld65-err) 2>&1
|
|
|
|
$(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib > $$(@:.bin=.ld65-err) $(ERRDIR)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
$(CA65) -t none -o $$(@:.bin=.o) $$< > $$(@:.bin=.err) 2>&1 || true
|
|
|
|
$(CA65) -t none -o $$(@:.bin=.o) $$< > $$(@:.bin=.err) $(ERRDIR) || $(TRUE)
|
|
|
|
ifeq ($(wildcard control/$1.no-ld65),)
|
|
|
|
ifeq ($(wildcard control/$1.no-ld65),)
|
|
|
|
$(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib > $$(@:.bin=.ld65-err) 2>&1 || true
|
|
|
|
$(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib > $$(@:.bin=.ld65-err) $(ERRDIR) || $(TRUE)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
@@ -71,14 +79,15 @@ ifneq ($(wildcard ref/$1.bin-ref),)
|
|
|
|
$(ISEQUAL) --binary ref/$1.bin-ref $$@
|
|
|
|
$(ISEQUAL) --binary ref/$1.bin-ref $$@
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# rem $(indfo $(CAT) $(subst /,$$S,$$$(@:.bin=.ld65-err)))
|
|
|
|
|
|
|
|
|
|
|
|
ifneq ($(wildcard ref/$1.ld65err-ref),)
|
|
|
|
ifneq ($(wildcard ref/$1.ld65err-ref),)
|
|
|
|
@echo cat $$(@:.bin=.ld65-err)
|
|
|
|
@echo $(CAT) $$(@:.bin=.ld65-err)
|
|
|
|
cat $$(@:.bin=.ld65-err)
|
|
|
|
# FIXME: somehow this refuses to work in cmd.exe
|
|
|
|
@echo
|
|
|
|
ifndef CMD_EXE
|
|
|
|
@echo
|
|
|
|
$(call CAT,$$(@:.bin=.ld65-err))
|
|
|
|
-diff -u ref/$1.ld65err-ref $$(@:.bin=.ld65-err)
|
|
|
|
-diff -u ref/$1.ld65err-ref $$(@:.bin=.ld65-err)
|
|
|
|
@echo
|
|
|
|
endif
|
|
|
|
@echo
|
|
|
|
|
|
|
|
$(ISEQUAL) --wildcards ref/$1.ld65err-ref $$(@:.bin=.ld65-err)
|
|
|
|
$(ISEQUAL) --wildcards ref/$1.ld65err-ref $$(@:.bin=.ld65-err)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
ifneq ($(wildcard $(WORKDIR)/$1.ld65-err),)
|
|
|
|
ifneq ($(wildcard $(WORKDIR)/$1.ld65-err),)
|
|
|
|
@@ -88,14 +97,14 @@ endif
|
|
|
|
|
|
|
|
|
|
|
|
# compile with listing file
|
|
|
|
# compile with listing file
|
|
|
|
ifeq ($(wildcard control/$1.err),)
|
|
|
|
ifeq ($(wildcard control/$1.err),)
|
|
|
|
$(CA65) -t none -l $$(@:.bin=.list-lst) -o $$(@:.bin=.list-o) $$< > $$(@:.bin=.list-err) 2>&1
|
|
|
|
$(CA65) -t none -l $$(@:.bin=.list-lst) -o $$(@:.bin=.list-o) $$< > $$(@:.bin=.list-err) $(ERRDIR)
|
|
|
|
ifeq ($(wildcard control/$1.no-ld65),)
|
|
|
|
ifeq ($(wildcard control/$1.no-ld65),)
|
|
|
|
$(LD65) -t none -o $$(@:.bin=.list-bin) $$(@:.bin=.list-o) none.lib > $$(@:.bin=.list-ld65-err) 2>&1
|
|
|
|
$(LD65) -t none -o $$(@:.bin=.list-bin) $$(@:.bin=.list-o) none.lib > $$(@:.bin=.list-ld65-err) $(ERRDIR)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
else
|
|
|
|
$(CA65) -t none -l $$(@:.bin=.list-lst) -o $$(@:.bin=.list-o) $$< > $$(@:.bin=.list-err) 2>&1 || true
|
|
|
|
$(CA65) -t none -l $$(@:.bin=.list-lst) -o $$(@:.bin=.list-o) $$< > $$(@:.bin=.list-err) $(ERRDIR) || $(TRUE)
|
|
|
|
ifeq ($(wildcard control/$1.no-ld65),)
|
|
|
|
ifeq ($(wildcard control/$1.no-ld65),)
|
|
|
|
$(LD65) -t none -o $$(@:.bin=.list-bin) $$(@:.bin=.list-o) none.lib > $$(@:.bin=.list-ld65-err) 2>&1 || true
|
|
|
|
$(LD65) -t none -o $$(@:.bin=.list-bin) $$(@:.bin=.list-o) none.lib > $$(@:.bin=.list-ld65-err) $(ERRDIR) || $(TRUE)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|