Add software files
This commit is contained in:
27
sw/Makefile
Normal file
27
sw/Makefile
Normal file
@@ -0,0 +1,27 @@
|
||||
CC=cl65
|
||||
CFLAGS=-t none
|
||||
LDFLAGS=-C link.ld
|
||||
|
||||
NAME=main
|
||||
|
||||
BIN=$(NAME).bin
|
||||
HEX=$(NAME).hex
|
||||
|
||||
SRCS=$(wildcard *.S) $(wildcard *.c)
|
||||
OBJS+=$(patsubst %.S,%.o,$(filter %S,$(SRCS)))
|
||||
OBJS+=$(patsubst %.c,%.o,$(filter %c,$(SRCS)))
|
||||
|
||||
all: $(BIN)
|
||||
objcopy --input-target=binary --output-target=ihex $(BIN) $(HEX)
|
||||
|
||||
|
||||
$(BIN): $(OBJS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(OBJS) $(BIN) $(HEX)
|
||||
|
||||
Reference in New Issue
Block a user