-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (31 loc) · 961 Bytes
/
Makefile
File metadata and controls
42 lines (31 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#######################################################################
# General variables. Twiddle as you see fit.
#######################################################################
CC65_TARGET=c64
CC = cc65
AS = ca65
CL = ld65
CFLAGS = -t $(CC65_TARGET)
LDFLAGS = -t $(CC65_TARGET) -m $(PROGRAM).map --dbgfile $(PROGRAM).dbg
#######################################################################
PROGRAM:=dino.prg
SRCS:=$(sort $(wildcard *.c) $(wildcard *.s))
OBJECT_LIST:=$(SRCS:.c=.o)
OBJECT_LIST:=$(OBJECT_LIST:.s=.o)
LINK_OBJECTS:=$(addprefix objects/,$(OBJECT_LIST))
.phony all: $(PROGRAM)
.phony clean:
rm -fr objects
rm -f *.map
rm -f $(PROGRAM)
objects/%.s: %.c
mkdir -p objects
$(CC) -Oi -T -t c64 $< -o $@
objects/%.o: %.s
mkdir -p objects
$(AS) $(CFLAGS) -o $@ $<
objects/%.o: objects/%.s
mkdir -p objects
$(AS) $(CFLAGS) -o $@ $<
$(PROGRAM): $(LINK_OBJECTS)
$(CL) $(LDFLAGS) -o $@ $^ $(CC65_TARGET).lib