libpsys
annotate Makefile.in @ 9:9c24273f211b
first test is done
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Wed, 28 Sep 2011 03:42:01 +0300 |
parents | 3c0a306c5f01 |
children | 0f83e882fd04 |
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@9 | 21 CFLAGS = -std=c89 -pedantic -Wall $(dbg) $(opt) -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) |