-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 683 Bytes
/
Copy pathMakefile
File metadata and controls
39 lines (28 loc) · 683 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
PREFIX=/tmp/snes-sdk
OPTIMIZE=1
BIN?=bin
CFLAGS=-Wall
ifeq ($(OPTIMIZE),1)
CFLAGS += -O
endif
BINDIR=$(PREFIX)/bin
AS=$(BINDIR)/wla-65816
LD=$(BINDIR)/wlalink
CC=$(BINDIR)/816-tcc
LIBDIR=$(PREFIX)/lib
SRC = data.asm main.c input.c init.c graph.c str.c
all: $(BIN)/JoypadTest.smc
$(BIN)/JoypadTest.smc: $(SRC:%=$(BIN)/%.o)
@mkdir -p $(dir $@)
$(LD) -dSo $^ "$@"
$(BIN)/%.c.o: %.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -I. -o "$(BIN)/$*.c.s" -c $<
$(AS) -io "$(BIN)/$*.c.s" "$@"
@gcc -MM -MT "$@" -I. -o "$(BIN)/$*.dep" -c $<
$(BIN)/%.asm.o: %.asm
@mkdir -p $(dir $@)
$(AS) -io $< $@
clean:
rm -rf $(BIN)
-include $(shell test -d $(BIN) && find $(BIN) -name "*.dep")