-
# makefile for the regression tests that generate output which has to be
# compared with reference output
DIFF := $(WORKDIR)/bdiff
CC := gcc
-CFLAGS := -O2 -Wall -W -Wextra -fwrapv -fno-strict-overflow
+CFLAGS := -O2 -Wall -W -Wextra -funsigned-char -fwrapv -fno-strict-overflow
.PHONY: all clean
all: $(REFS) $(TESTS)
+# "yaccdbg.c" includes "yacc.c".
+# yaccdbg's built files must depend on both of them.
+
+$(WORKDIR)/yaccdbg.ref: yacc.c
+
$(WORKDIR)/%.ref: %.c
$(CC) $(CFLAGS) $< -o $(WORKDIR)/$*.host
$(WORKDIR)$S$*.host > $@
$(WORKDIR)/yacc.%rg: CC65FLAGS += -Wc --all-cdecl
$(WORKDIR)/yaccdbg%prg: CC65FLAGS += -Wc --all-cdecl
+$(WORKDIR)/yaccdbg%prg: yacc.c
+
$(WORKDIR)/%.prg: %.c $(WORKDIR)/%.ref
$(CL65) $(CC65FLAGS) $< -o $@
$(SIM65) $(SIM65FLAGS) $@ > $(WORKDIR)/$*.out