1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 06:31:31 +00:00
cc65/test/err/Makefile

46 lines
767 B
Makefile
Raw Normal View History

2017-03-19 16:48:12 +00:00
# Makefile for the tests that MUST NOT compile
2014-11-23 11:18:19 +00:00
ifneq ($(shell echo),)
2017-03-19 16:48:12 +00:00
CMD_EXE = 1
2014-11-23 11:18:19 +00:00
endif
ifdef CMD_EXE
S = $(subst /,\,/)
2017-03-19 16:48:12 +00:00
NOT = - # Hack
NULLDEV = nul:
2017-03-19 16:48:12 +00:00
MKDIR = mkdir $(subst /,\,$1)
RMDIR = -rmdir /s /q $(subst /,\,$1)
2014-11-23 11:18:19 +00:00
else
S = /
2017-03-19 16:48:12 +00:00
NOT = !
NULLDEV = /dev/null
2017-03-19 16:48:12 +00:00
MKDIR = mkdir -p $1
RMDIR = $(RM) -r $1
2014-11-23 11:18:19 +00:00
endif
ifdef QUIET
.SILENT:
NULLERR = 2>$(NULLDEV)
endif
CL65 := $(if $(wildcard ../../bin/cl65*),..$S..$Sbin$Scl65,cl65)
2015-06-26 22:03:45 +00:00
2017-03-19 16:48:12 +00:00
WORKDIR = ../../testwrk/err
2014-11-25 11:56:45 +00:00
2014-11-23 11:18:19 +00:00
.PHONY: all clean
2017-03-19 16:48:12 +00:00
SOURCES := $(wildcard *.c)
TESTS = $(patsubst %.c,$(WORKDIR)/%.prg,$(SOURCES))
all: $(TESTS)
$(WORKDIR):
$(call MKDIR,$(WORKDIR))
$(WORKDIR)/%.prg: %.c | $(WORKDIR)
$(if $(QUIET),echo err/$*.s)
$(NOT) $(CL65) -o $@ $< $(NULLERR)
2014-12-17 22:44:39 +00:00
clean:
2017-03-19 16:48:12 +00:00
@$(call RMDIR,$(WORKDIR))