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 *.ilk
*.map *.map
*.exp *.exp
lists/
# Precompiled Headers # Precompiled Headers
*.gch *.gch

View File

@@ -1,12 +1,14 @@
CC=cl65 CC=cl65
CFLAGS=-t none -I. --cpu "65C02" CFLAGS=-t none -I. --cpu "65C02"
LDFLAGS=-C link.ld LDFLAGS=-C link.ld -m $(NAME).map
NAME=bootrom NAME=bootrom
BIN=$(NAME).bin BIN=$(NAME).bin
HEX=$(NAME).hex HEX=$(NAME).hex
LISTS=lists/
SRCS=$(wildcard *.s) $(wildcard *.c) SRCS=$(wildcard *.s) $(wildcard *.c)
OBJS+=$(patsubst %.s,%.o,$(filter %s,$(SRCS))) OBJS+=$(patsubst %.s,%.o,$(filter %s,$(SRCS)))
OBJS+=$(patsubst %.c,%.o,$(filter %c,$(SRCS))) OBJS+=$(patsubst %.c,%.o,$(filter %c,$(SRCS)))
@@ -20,12 +22,14 @@ $(HEX): $(BIN)
$(BIN): $(OBJS) $(BIN): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
%.o: %.c %.o: %.c $(LISTS)
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -l $(LISTS)/$<.list -c $< -o $@
%.o: %.s %.o: %.s $(LISTS)
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -l $(LISTS)/$<.list -c $< -o $@
$(LISTS):
mkdir $(LISTS)
.PHONY: clean .PHONY: clean
clean: clean: