summaryrefslogtreecommitdiffstats
path: root/sw/z80/arch/makefile
blob: 2763c1030f7742110627ba2e5803db0a5458e4fb (plain)
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
# Drivers library

LIB     := build/arch.a
SOURCES := $(wildcard *.c)
OBJECTS := $(patsubst %.c,build/%.rel,$(SOURCES))

F_CPU := 10000

CC := sdcc
AR := sdar
CFLAGS := -mz80 \
			-Iinclude \
			-DDEBUG \
			-DF_CPU=$(F_CPU)

.PHONY: dirs clean
$(LIB): $(OBJECTS)
	$(AR) rcs $@ $(OBJECTS)

$(OBJECTS): build/%.rel: %.c $(SOURCES) dirs
	$(CC) $(CFLAGS) -c $< -o $@

dirs:
	mkdir -p build

clean:
	- rm -rd build