gbasys

view Makefile @ 1:c50064b181c2

stuff
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 04 Mar 2012 07:06:41 +0200
parents 875ef6085efc
children 1807781b4503
line source
1 PREFIX = /usr/local/gba
3 src = $(wildcard src/*.c)
4 obj = $(src:.c=.o)
5 liba = libgbasys.a
7 CPP = arm-eabi-cpp
8 CC = arm-eabi-gcc
9 AS = arm-eabi-as
10 AR = arm-eabi-ar
12 CFLAGS = -pedantic -marm -mcpu=arm7tdmi -Isrc
14 $(liba): $(obj)
15 $(AR) rcs $@ $(obj)
17 -include $(obj:.o=.d)
19 %.d: %.c
20 @$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@
22 .PHONY: clean
23 clean:
24 rm -f $(obj) $(liba)
26 .PHONY: install
27 install: $(liba)
28 mkdir -p $(DESTDIR)$(PREFIX)/lib $(DESTDIR)$(PREFIX)/include/gbasys
29 cp $(liba) $(DESTDIR)$(PREFIX)/lib/$(liba)
30 cp $(hdr) $(DESTDIR)$(PREFIX)/include/gbasys/
32 .PHONY: uninstall
33 uninstall:
34 rm -f $(DESTDIR)$(PREFIX)/lib/$(liba)
35 rm -f $(DESTDIR)$(PREFIX)/include/gbasys/*.h
36 rmdir $(DESTDIR)$(PREFIX)/include/gbasys