1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-05 21:29:03 +00:00
cc65/test/err/Makefile
Oliver Schmidt 50b0536222 Ignore return values only with CMD.EXE MkII.
CMD.EXE considers file deletion commands not able to delete anything as there's nothing to delete as failed. Of course we don't want to bail out of the Makefile because of missing files to delete. Therefore we ignore the return values with '-'. This change limits this workaround to CMD.EXE.
2015-07-11 00:01:39 +02:00

49 lines
1.1 KiB
Makefile

# makefile for the tests that MUST NOT compile
ifneq ($(shell echo),)
CMD_EXE := 1
endif
ifdef CMD_EXE
NOT := - # Hack
DEL = -del /f $(subst /,\,$1)
else
NOT := !
DEL = $(RM) $1
endif
CC65FLAGS := -t sim6502
CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
WORKDIR := ../../testwrk
.PHONY: all clean
SOURCES := $(wildcard *.c)
TESTS := $(foreach option,. .o. .os. .osi. .osir. .oi. .oir. .or.,$(SOURCES:%.c=$(WORKDIR)/%$(option)prg))
all: $(TESTS)
$(WORKDIR)/%.prg: %.c
$(NOT) $(CL65) $(CC65FLAGS) $< -o $@
$(WORKDIR)/%.o.prg: %.c
$(NOT) $(CL65) -O $(CC65FLAGS) $< -o $@
$(WORKDIR)/%.os.prg: %.c
$(NOT) $(CL65) -Os $(CC65FLAGS) $< -o $@
$(WORKDIR)/%.osi.prg: %.c
$(NOT) $(CL65) -Osi $(CC65FLAGS) $< -o $@
$(WORKDIR)/%.osir.prg: %.c
$(NOT) $(CL65) -Osir $(CC65FLAGS) $< -o $@
$(WORKDIR)/%.oi.prg: %.c
$(NOT) $(CL65) -Oi $(CC65FLAGS) $< -o $@
$(WORKDIR)/%.oir.prg: %.c
$(NOT) $(CL65) -Oir $(CC65FLAGS) $< -o $@
$(WORKDIR)/%.or.prg: %.c
$(NOT) $(CL65) -Or $(CC65FLAGS) $< -o $@
clean:
@$(call DEL,$(TESTS))
@$(call DEL,$(SOURCES:.c=.o))