diff --git a/sw/.gitignore b/sw/.gitignore index c6127b3..9b97224 100644 --- a/sw/.gitignore +++ b/sw/.gitignore @@ -11,6 +11,7 @@ *.ilk *.map *.exp +lists/ # Precompiled Headers *.gch diff --git a/sw/Makefile b/sw/Makefile index 88e32fa..87980e3 100644 --- a/sw/Makefile +++ b/sw/Makefile @@ -1,12 +1,14 @@ CC=cl65 CFLAGS=-t none -I. --cpu "65C02" -LDFLAGS=-C link.ld +LDFLAGS=-C link.ld -m $(NAME).map NAME=bootrom BIN=$(NAME).bin HEX=$(NAME).hex +LISTS=lists/ + SRCS=$(wildcard *.s) $(wildcard *.c) OBJS+=$(patsubst %.s,%.o,$(filter %s,$(SRCS))) OBJS+=$(patsubst %.c,%.o,$(filter %c,$(SRCS))) @@ -20,12 +22,14 @@ $(HEX): $(BIN) $(BIN): $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ -%.o: %.c - $(CC) $(CFLAGS) -c $< -o $@ +%.o: %.c $(LISTS) + $(CC) $(CFLAGS) -l $(LISTS)/$<.list -c $< -o $@ -%.o: %.s - $(CC) $(CFLAGS) -c $< -o $@ +%.o: %.s $(LISTS) + $(CC) $(CFLAGS) -l $(LISTS)/$<.list -c $< -o $@ +$(LISTS): + mkdir $(LISTS) .PHONY: clean clean: