1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-11 11:30:13 +00:00
cc65/test/err/Makefile

46 lines
763 B
Makefile
Raw Normal View History

2017-03-19 17:48:12 +01:00
# Makefile for the tests that MUST NOT compile
2014-11-23 12:18:19 +01:00
ifneq ($(shell echo),)
2017-03-19 17:48:12 +01:00
CMD_EXE = 1
2014-11-23 12:18:19 +01:00
endif
ifdef CMD_EXE
S = $(subst /,\,/)
2017-03-19 17:48:12 +01:00
NOT = - # Hack
NULLDEV = nul:
2017-03-19 17:48:12 +01:00
MKDIR = mkdir $(subst /,\,$1)
RMDIR = -rmdir /s /q $(subst /,\,$1)
2014-11-23 12:18:19 +01:00
else
S = /
2017-03-19 17:48:12 +01:00
NOT = !
NULLDEV = /dev/null
2017-03-19 17:48:12 +01:00
MKDIR = mkdir -p $1
RMDIR = $(RM) -r $1
2014-11-23 12:18:19 +01:00
endif
ifdef QUIET
.SILENT:
NULLERR = 2>$(NULLDEV)
endif
CC65 := $(if $(wildcard ../../bin/cc65*),..$S..$Sbin$Scc65,cc65)
2015-06-27 00:03:45 +02:00
2017-03-19 17:48:12 +01:00
WORKDIR = ../../testwrk/err
2014-11-25 12:56:45 +01:00
2014-11-23 12:18:19 +01:00
.PHONY: all clean
2017-03-19 17:48:12 +01:00
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)
2014-12-17 17:44:39 -05:00
clean:
2017-03-19 17:48:12 +01:00
@$(call RMDIR,$(WORKDIR))