-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
45 lines (34 loc) · 1 KB
/
Copy pathmakefile
File metadata and controls
45 lines (34 loc) · 1 KB
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
43
44
45
# Another World Commander X16
# Makefile for Linux / macOS systems
# --- config --------------------------------------------------------------
AS := ca65
LD := ld65
CPU := w65c02
TARGET := cx16
INC := inc
CFG := cx16-asm.cfg
LIBS := cx16.lib
BIN := bin
OBJDIR := $(BIN)/obj
OUT := $(BIN)/another.prg
ASFLAGS := --cpu $(CPU) -t $(TARGET) -I $(INC) -g
LDFLAGS := -u __EXEHDR__ -C $(CFG)
SRC := \
main.s bank.s engine.s input.s irq.s opcodes.s polygon.s resource.s \
sample.s tasks.s text.s vera.s unpacker.s unpack.s
SRCDIR := src
SRCS := $(addprefix $(SRCDIR)/,$(SRC))
OBJS := $(addprefix $(OBJDIR)/,$(SRC:.s=.o))
# --- targets -------------------------------------------------------------
.PHONY: all clean
all: $(OUT)
$(OUT): | $(BIN) $(OBJDIR) $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
# assemble each .s -> .o
$(OBJDIR)/%.o: $(SRCDIR)/%.s | $(OBJDIR)
$(AS) $(ASFLAGS) -o $@ $<
# ensure dirs exist
$(BIN) $(OBJDIR):
mkdir -p $@
clean:
rm -rf $(OBJDIR) $(OUT)