libpsys
annotate Makefile.in @ 2:6e5342a2529a
more stuff done
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Sun, 25 Sep 2011 04:26:51 +0300 |
parents | |
children | 3c0a306c5f01 |
rev | line source |
---|---|
nuclear@0 | 1 src = $(wildcard src/*.c) |
nuclear@0 | 2 obj = $(src:.c=.o) |
nuclear@0 | 3 lib_a = libpsys.a |
nuclear@0 | 4 lib_so = libpsys.so |
nuclear@0 | 5 |
nuclear@0 | 6 CC = gcc |
nuclear@0 | 7 CFLAGS = -std=c89 -pedantic -Wall -g -fPIC -Isrc `pkg-config --cflags vmath` |
nuclear@0 | 8 LDFLAGS = `pkg-config --libs vmath` |
nuclear@0 | 9 |
nuclear@0 | 10 .PHONY: all |
nuclear@0 | 11 all: $(lib_a) $(lib_so) |
nuclear@0 | 12 |
nuclear@0 | 13 $(lib_a): $(obj) |
nuclear@0 | 14 $(AR) rcs $@ $^ |
nuclear@0 | 15 |
nuclear@0 | 16 $(lib_so): $(obj) |
nuclear@0 | 17 $(CC) $(CFLAGS) -shared -o $@ $^ $(LDFLAGS) |
nuclear@0 | 18 |
nuclear@0 | 19 .PHONY: install |
nuclear@0 | 20 install: $(lib_a) $(lib_so) |
nuclear@0 | 21 install -d $(PREFIX)/lib |
nuclear@0 | 22 install -m 644 $(lib_a) $(lib_so) $(PREFIX)/lib |
nuclear@0 | 23 install -d $(PREFIX)/include |
nuclear@0 | 24 install -m 644 src/psys.h $(PREFIX)/include/psys.h |
nuclear@0 | 25 install -d $(PREFIX)/lib/pkgconfig |
nuclear@0 | 26 install -m 644 psys.pc $(PREFIX)/lib/pkgconfig/psys.pc |
nuclear@0 | 27 |
nuclear@0 | 28 .PHONY: uninstall |
nuclear@0 | 29 uninstall: |
nuclear@0 | 30 rm -f $(PREFIX)/lib/$(lib_a) |
nuclear@0 | 31 rm -f $(PREFIX)/lib/$(lib_so) |
nuclear@0 | 32 rm -f $(PREFIX)/include/psys.h |
nuclear@0 | 33 rm -f $(PREFIX)/lib/pkgconfig/psys.pc |
nuclear@0 | 34 |
nuclear@0 | 35 .PHONY: clean |
nuclear@0 | 36 clean: |
nuclear@0 | 37 rm -f $(obj) |
nuclear@0 | 38 |
nuclear@0 | 39 .PHONY: distclean |
nuclear@0 | 40 distclean: |
nuclear@0 | 41 rm -f $(obj) $(lib_so) $(lib_a) Makefile psys.pc |
nuclear@0 | 42 |
nuclear@0 | 43 .PHONY: dist |
nuclear@0 | 44 dist: distclean |
nuclear@0 | 45 cd ..; tar czvf psys.tar.gz psys && mv psys.tar.gz psys/ |