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 992f0f03c5 Ignore return values only with CMD.EXE.
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-10 22:39:53 +02:00

51 lines
1.1 KiB
Makefile

# makefile for the tests that MUST NOT compile
ifneq ($(shell echo),)
CMD_EXE := 1
endif
ifdef CMD_EXE
M := -
NOT := - # Hack
DEL = del /f $(subst /,\,$1)
else
M :=
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:
$M@$(call DEL,$(TESTS))
$M@$(call DEL,$(SOURCES:.c=.o))