mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
81 lines
1.8 KiB
Makefile
81 lines
1.8 KiB
Makefile
|
|
# makefile for the regression tests that generate output which has to be
|
|
# compared with reference output
|
|
|
|
CC65FLAGS = -t sim6502
|
|
SIM65FLAGS = -x 200000000
|
|
|
|
CL65 := $(if $(wildcard ../../bin/cl65*),../../bin/cl65,cl65)
|
|
SIM65 := $(if $(wildcard ../../bin/sim65*),../../bin/sim65,sim65)
|
|
|
|
RM := rm -f
|
|
DIFF := diff -q
|
|
|
|
CFLAGS := -O2 -Wall -W -Wextra -fwrapv -fno-strict-overflow
|
|
|
|
.PHONY: all
|
|
|
|
REFS := $(patsubst %.c,%.ref,$(wildcard *.c))
|
|
|
|
TESTS := $(patsubst %.c,%.prg,$(wildcard *.c))
|
|
TESTS += $(patsubst %.c,%.o.prg,$(wildcard *.c))
|
|
TESTS += $(patsubst %.c,%.os.prg,$(wildcard *.c))
|
|
TESTS += $(patsubst %.c,%.osi.prg,$(wildcard *.c))
|
|
TESTS += $(patsubst %.c,%.osir.prg,$(wildcard *.c))
|
|
TESTS += $(patsubst %.c,%.oi.prg,$(wildcard *.c))
|
|
TESTS += $(patsubst %.c,%.oir.prg,$(wildcard *.c))
|
|
TESTS += $(patsubst %.c,%.or.prg,$(wildcard *.c))
|
|
|
|
all: $(REFS) $(TESTS)
|
|
|
|
%.ref: %.c
|
|
$(CC) $(CFLAGS) $< -o $*.host
|
|
./$*.host > $@
|
|
|
|
%.prg: %.c %.ref
|
|
$(CL65) $(CC65FLAGS) $< -o $@
|
|
$(SIM65) $(SIM65FLAGS) $@ > $*.out
|
|
$(DIFF) $*.out $*.ref
|
|
|
|
%.o.prg: %.c %.ref
|
|
$(CL65) $(CC65FLAGS) $< -o $@
|
|
$(SIM65) $(SIM65FLAGS) $@ > $*.out
|
|
$(DIFF) $*.out $*.ref
|
|
|
|
%.os.prg: %.c %.ref
|
|
$(CL65) $(CC65FLAGS) $< -o $@
|
|
$(SIM65) $(SIM65FLAGS) $@ > $*.out
|
|
$(DIFF) $*.out $*.ref
|
|
|
|
%.osi.prg: %.c %.ref
|
|
$(CL65) $(CC65FLAGS) $< -o $@
|
|
$(SIM65) $(SIM65FLAGS) $@ > $*.out
|
|
$(DIFF) $*.out $*.ref
|
|
|
|
%.osir.prg: %.c %.ref
|
|
$(CL65) $(CC65FLAGS) $< -o $@
|
|
$(SIM65) $(SIM65FLAGS) $@ > $*.out
|
|
$(DIFF) $*.out $*.ref
|
|
|
|
%.oi.prg: %.c %.ref
|
|
$(CL65) $(CC65FLAGS) $< -o $@
|
|
$(SIM65) $(SIM65FLAGS) $@ > $*.out
|
|
$(DIFF) $*.out $*.ref
|
|
|
|
%.oir.prg: %.c %.ref
|
|
$(CL65) $(CC65FLAGS) $< -o $@
|
|
$(SIM65) $(SIM65FLAGS) $@ > $*.out
|
|
$(DIFF) $*.out $*.ref
|
|
|
|
%.or.prg: %.c %.ref
|
|
$(CL65) $(CC65FLAGS) $< -o $@
|
|
$(SIM65) $(SIM65FLAGS) $@ > $*.out
|
|
$(DIFF) $*.out $*.ref
|
|
|
|
clean:
|
|
@$(RM) *.o
|
|
@$(RM) *.prg
|
|
@$(RM) *.out
|
|
@$(RM) *.ref
|
|
@$(RM) *.host
|