libpsys

diff Makefile.in @ 0:1c8eb90a6989

initial commit
author John Tsiombikas <nuclear@mutantstargoat.com>
date Sat, 24 Sep 2011 07:22:07 +0300
parents
children 3c0a306c5f01
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile.in	Sat Sep 24 07:22:07 2011 +0300
     1.3 @@ -0,0 +1,45 @@
     1.4 +src = $(wildcard src/*.c)
     1.5 +obj = $(src:.c=.o)
     1.6 +lib_a = libpsys.a
     1.7 +lib_so = libpsys.so
     1.8 +
     1.9 +CC = gcc
    1.10 +CFLAGS = -std=c89 -pedantic -Wall -g -fPIC -Isrc `pkg-config --cflags vmath`
    1.11 +LDFLAGS = `pkg-config --libs vmath`
    1.12 +
    1.13 +.PHONY: all
    1.14 +all: $(lib_a) $(lib_so)
    1.15 +
    1.16 +$(lib_a): $(obj)
    1.17 +	$(AR) rcs $@ $^
    1.18 +
    1.19 +$(lib_so): $(obj)
    1.20 +	$(CC) $(CFLAGS) -shared -o $@ $^ $(LDFLAGS)
    1.21 +
    1.22 +.PHONY: install
    1.23 +install: $(lib_a) $(lib_so)
    1.24 +	install -d $(PREFIX)/lib
    1.25 +	install -m 644 $(lib_a) $(lib_so) $(PREFIX)/lib
    1.26 +	install -d $(PREFIX)/include
    1.27 +	install -m 644 src/psys.h $(PREFIX)/include/psys.h
    1.28 +	install -d $(PREFIX)/lib/pkgconfig
    1.29 +	install -m 644 psys.pc $(PREFIX)/lib/pkgconfig/psys.pc
    1.30 +
    1.31 +.PHONY: uninstall
    1.32 +uninstall:
    1.33 +	rm -f $(PREFIX)/lib/$(lib_a)
    1.34 +	rm -f $(PREFIX)/lib/$(lib_so)
    1.35 +	rm -f $(PREFIX)/include/psys.h
    1.36 +	rm -f $(PREFIX)/lib/pkgconfig/psys.pc
    1.37 +
    1.38 +.PHONY: clean
    1.39 +clean:
    1.40 +	rm -f $(obj)
    1.41 +
    1.42 +.PHONY: distclean
    1.43 +distclean:
    1.44 +	rm -f $(obj) $(lib_so) $(lib_a) Makefile psys.pc
    1.45 +
    1.46 +.PHONY: dist
    1.47 +dist: distclean
    1.48 +	cd ..; tar czvf psys.tar.gz psys && mv psys.tar.gz psys/