libpsys

annotate 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
rev   line source
nuclear@0 1 src = $(wildcard src/*.c)
nuclear@0 2 obj = $(src:.c=.o)
nuclear@7 3 dep = $(obj:.o=.d)
nuclear@0 4 lib_a = libpsys.a
nuclear@7 5
nuclear@7 6 ifeq ($(shell uname -s), Darwin)
nuclear@7 7 lib_so = psys.dylib
nuclear@7 8 shared = -dynamiclib
nuclear@7 9 else
nuclear@7 10 somajor = 0
nuclear@7 11 sominor = 1
nuclear@7 12 soname = libpsys.so.$(somajor)
nuclear@7 13 lib_so = $(soname).$(sominor)
nuclear@7 14 solink = libpsys.so
nuclear@7 15 shared = -shared -Wl,-soname,$(soname)
nuclear@7 16 endif
nuclear@7 17
nuclear@0 18
nuclear@0 19 CC = gcc
nuclear@7 20 AR = ar
nuclear@7 21 CFLAGS = -std=c89 -pedantic -Wall -g -fPIC -Isrc
nuclear@7 22 LDFLAGS = -lanim -limago -lvmath
nuclear@0 23
nuclear@0 24 .PHONY: all
nuclear@0 25 all: $(lib_a) $(lib_so)
nuclear@0 26
nuclear@0 27 $(lib_a): $(obj)
nuclear@7 28 $(AR) rcs $@ $(obj)
nuclear@0 29
nuclear@0 30 $(lib_so): $(obj)
nuclear@7 31 $(CC) $(shared) -o $@ $(obj) $(LDFLAGS)
nuclear@7 32
nuclear@7 33 -include $(dep)
nuclear@7 34
nuclear@7 35 %.d: %.c
nuclear@7 36 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@7 37
nuclear@0 38
nuclear@0 39 .PHONY: install
nuclear@0 40 install: $(lib_a) $(lib_so)
nuclear@7 41 @echo TODO
nuclear@0 42
nuclear@0 43 .PHONY: uninstall
nuclear@0 44 uninstall:
nuclear@7 45 @echo TODO
nuclear@0 46
nuclear@0 47 .PHONY: clean
nuclear@0 48 clean:
nuclear@7 49 rm -f $(obj) $(lib_so) $(lib_a)