Update makefile

Generates listing files and a map file now.
This commit is contained in:
Byron Lathi
2022-03-10 10:25:36 -06:00
parent 3f5a653326
commit 80d49b4f87
2 changed files with 10 additions and 5 deletions

1
sw/.gitignore vendored
View File

@@ -11,6 +11,7 @@
*.ilk
*.map
*.exp
lists/
# Precompiled Headers
*.gch

View File

@@ -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: