gbasys

diff 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
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Sun Mar 04 04:04:25 2012 +0200
     1.3 @@ -0,0 +1,36 @@
     1.4 +PREFIX = /usr/local/gba
     1.5 +
     1.6 +src = $(wildcard src/*.c)
     1.7 +obj = $(src:.c=.o)
     1.8 +liba = libgbasys.a
     1.9 +
    1.10 +CPP = arm-agb-elf-cpp
    1.11 +CC = arm-agb-elf-gcc
    1.12 +AS = arm-agb-elf-as
    1.13 +AR = arm-agb-elf-ar
    1.14 +
    1.15 +CFLAGS = -pedantic -marm -mcpu=arm7tdmi -Isrc
    1.16 +
    1.17 +$(liba): $(obj)
    1.18 +	$(AR) rcs $@ $(obj)
    1.19 +
    1.20 +-include $(obj:.o=.d)
    1.21 +
    1.22 +%.d: %.c
    1.23 +	@$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@
    1.24 +
    1.25 +.PHONY: clean
    1.26 +clean:
    1.27 +	rm -f $(obj) $(liba)
    1.28 +
    1.29 +.PHONY: install
    1.30 +install: $(liba)
    1.31 +	mkdir -p $(DESTDIR)$(PREFIX)/lib $(DESTDIR)$(PREFIX)/include/gbasys
    1.32 +	cp $(liba) $(DESTDIR)$(PREFIX)/lib/$(liba)
    1.33 +	cp $(hdr) $(DESTDIR)$(PREFIX)/include/gbasys/
    1.34 +
    1.35 +.PHONY: uninstall
    1.36 +uninstall:
    1.37 +	rm -f $(DESTDIR)$(PREFIX)/lib/$(liba)
    1.38 +	rm -f $(DESTDIR)$(PREFIX)/include/gbasys/*.h
    1.39 +	rmdir $(DESTDIR)$(PREFIX)/include/gbasys