1
0
mirror of https://github.com/cc65/cc65.git synced 2024-10-31 20:06:11 +00:00
cc65/test/err/Makefile
Jesse Rosenstock 4b7cd491e3 Move #1209 test from err/ to misc/
misc/ is the correct place for tests that should compile
but do not.

Revert err/Makefile changes from #1210.
2020-08-24 18:07:31 +02:00

46 lines
763 B
Makefile

# 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
CC65 := $(if $(wildcard ../../bin/cc65*),..$S..$Sbin$Scc65,cc65)
WORKDIR = ../../testwrk/err
.PHONY: all clean
SOURCES := $(wildcard *.c)
TESTS = $(patsubst %.c,$(WORKDIR)/%.s,$(SOURCES))
all: $(TESTS)
$(WORKDIR):
$(call MKDIR,$(WORKDIR))
$(WORKDIR)/%.s: %.c | $(WORKDIR)
$(if $(QUIET),echo err/$*.s)
$(NOT) $(CC65) -o $@ $< $(NULLERR)
clean:
@$(call RMDIR,$(WORKDIR))