gbasys

view Makefile @ 6:f77381b12726

palette
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 04 Sep 2012 05:05:50 +0300
parents c50064b181c2
children 047c61960005
line source
1 PREFIX = /usr/local/gba
3 src = $(wildcard src/*.c)
4 obj = $(src:.c=.o)
5 liba = libgbasys.a
7 ARCH = arm-eabi
9 CPP = $(ARCH)-cpp
10 CC = $(ARCH)-gcc
11 AS = $(ARCH)-as
12 AR = $(ARCH)-ar
14 CFLAGS = -pedantic -marm -mcpu=arm7tdmi -Isrc
16 $(liba): $(obj)
17 $(AR) rcs $@ $(obj)
19 -include $(obj:.o=.d)
21 %.d: %.c
22 @$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@
24 .PHONY: clean
25 clean:
26 rm -f $(obj) $(liba)
28 .PHONY: install
29 install: $(liba)
30 mkdir -p $(DESTDIR)$(PREFIX)/lib $(DESTDIR)$(PREFIX)/include/gbasys
31 cp $(liba) $(DESTDIR)$(PREFIX)/lib/$(liba)
32 cp $(hdr) $(DESTDIR)$(PREFIX)/include/gbasys/
34 .PHONY: uninstall
35 uninstall:
36 rm -f $(DESTDIR)$(PREFIX)/lib/$(liba)
37 rm -f $(DESTDIR)$(PREFIX)/include/gbasys/*.h
38 rmdir $(DESTDIR)$(PREFIX)/include/gbasys