gbasys

annotate Makefile @ 0:875ef6085efc

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