1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-30 04:29:26 +00:00
cc65/test/asm/err/Makefile

46 lines
785 B
Makefile
Raw Normal View History

2022-04-26 15:07:57 +00:00
# Makefile for the tests that MUST NOT compile
ifneq ($(shell echo),)
CMD_EXE = 1
endif
ifdef CMD_EXE
S = $(subst /,\,/)
NOT = - # Hack
NULLDEV = nul:
MKDIR = mkdir $(subst /,\,$1)
RMDIR = -rmdir /s /q $(subst /,\,$1)
else
S = /
NOT = !
NULLDEV = /dev/null
MKDIR = mkdir -p $1
RMDIR = $(RM) -r $1
endif
ifdef QUIET
.SILENT:
NULLERR = 2>$(NULLDEV)
endif
CA65 := $(if $(wildcard ../../../bin/ca65*),..$S..$S..$Sbin$Sca65,ca65)
WORKDIR = ../../../testwrk/asm/err
.PHONY: all clean
SOURCES := $(wildcard *.s)
TESTS = $(patsubst %.s,$(WORKDIR)/%.prg,$(SOURCES))
all: $(TESTS)
$(WORKDIR):
$(call MKDIR,$(WORKDIR))
$(WORKDIR)/%.prg: %.s | $(WORKDIR)
$(if $(QUIET),echo asm/err/$*.s)
$(NOT) $(CA65) -o $@ $< $(NULLERR)
clean:
@$(call RMDIR,$(WORKDIR))