libpsys

view Makefile.in @ 7:3c0a306c5f01

revamped the makefile a bit and changed all <vmath.h> to <vmath/vmath.h> to avoid relying on pkg-config
author John Tsiombikas <nuclear@mutantstargoat.com>
date Tue, 27 Sep 2011 07:52:01 +0300
parents 1c8eb90a6989
children 9c24273f211b
line source
1 src = $(wildcard src/*.c)
2 obj = $(src:.c=.o)
3 dep = $(obj:.o=.d)
4 lib_a = libpsys.a
6 ifeq ($(shell uname -s), Darwin)
7 lib_so = psys.dylib
8 shared = -dynamiclib
9 else
10 somajor = 0
11 sominor = 1
12 soname = libpsys.so.$(somajor)
13 lib_so = $(soname).$(sominor)
14 solink = libpsys.so
15 shared = -shared -Wl,-soname,$(soname)
16 endif
19 CC = gcc
20 AR = ar
21 CFLAGS = -std=c89 -pedantic -Wall -g -fPIC -Isrc
22 LDFLAGS = -lanim -limago -lvmath
24 .PHONY: all
25 all: $(lib_a) $(lib_so)
27 $(lib_a): $(obj)
28 $(AR) rcs $@ $(obj)
30 $(lib_so): $(obj)
31 $(CC) $(shared) -o $@ $(obj) $(LDFLAGS)
33 -include $(dep)
35 %.d: %.c
36 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
39 .PHONY: install
40 install: $(lib_a) $(lib_so)
41 @echo TODO
43 .PHONY: uninstall
44 uninstall:
45 @echo TODO
47 .PHONY: clean
48 clean:
49 rm -f $(obj) $(lib_so) $(lib_a)