libdrawtext

diff Makefile.in @ 0:bfe431dd1d80

initial commit
author John Tsiombikas <nuclear@mutantstargoat.com>
date Thu, 15 Sep 2011 10:47:38 +0300
parents
children 5de80fdb40db
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile.in	Thu Sep 15 10:47:38 2011 +0300
     1.3 @@ -0,0 +1,66 @@
     1.4 +src = $(wildcard src/*.c)
     1.5 +obj = $(src:.c=.o)
     1.6 +dep = $(obj:.o=.d)
     1.7 +
     1.8 +abi = 0
     1.9 +rev = 0
    1.10 +
    1.11 +name = libdrawtext
    1.12 +lib_a = $(name).a
    1.13 +
    1.14 +ifeq ($(shell uname -s), Darwin)
    1.15 +	lib_so = $(name).dylib
    1.16 +	sharedopt = -dynamiclib
    1.17 +
    1.18 +	libgl = -framework OpenGL -lGLEW
    1.19 +else
    1.20 +	soname = $(name).so.$(abi)
    1.21 +	lib_so = $(soname).$(rev)
    1.22 +	sharedopt = -shared -Wl,-soname,$(soname)
    1.23 +
    1.24 +	libgl = -lGL -lGLU -lGLEW
    1.25 +endif
    1.26 +
    1.27 +CC = gcc
    1.28 +CFLAGS = -pedantic -Wall -g -fPIC $(ft2_cflags)
    1.29 +LDFLAGS = $(ft2_libs) $(libgl)
    1.30 +
    1.31 +.PHONY: all
    1.32 +all: $(lib_a) $(lib_so)
    1.33 +
    1.34 +$(lib_a): $(obj)
    1.35 +	$(AR) rcs $@ $(obj)
    1.36 +
    1.37 +$(lib_so): $(obj)
    1.38 +	$(CC) $(sharedopt) -o $@ $(obj) $(LDFLAGS)
    1.39 +
    1.40 +-include $(dep)
    1.41 +
    1.42 +%.d: %.c
    1.43 +	@$(CPP) $(CFLAGS) -MM $< >$@
    1.44 +
    1.45 +
    1.46 +.PHONY: clean
    1.47 +clean:
    1.48 +	rm -f $(obj) $(lib_a) $(lib_so)
    1.49 +
    1.50 +.PHONY: cleandep
    1.51 +cleandep:
    1.52 +	rm -f $(dep)
    1.53 +
    1.54 +.PHONY: install
    1.55 +install: $(lib_a) $(lib_so)
    1.56 +	mkdir -p $(PREFIX)/lib $(PREFIX)/include
    1.57 +	cp $(lib_a) $(PREFIX)/lib/$(lib_a)
    1.58 +	cp $(lib_so) $(PREFIX)/lib/$(lib_so)
    1.59 +	cp src/drawtext.h $(PREFIX)/include/drawtext.h
    1.60 +	rm -f $(PREFIX)/lib/$(name).so
    1.61 +	cd $(PREFIX)/lib && ln -s $(lib_so) $(name).so
    1.62 +
    1.63 +
    1.64 +.PHONY: uninstall
    1.65 +uninstall:
    1.66 +	rm -f $(PREFIX)/lib/$(lib_a)
    1.67 +	rm -f $(PREFIX)/lib/$(lib_so)
    1.68 +	rm -f $(PREFIX)/lib/$(name).so
    1.69 +	rm -f $(PREFIX)/include/drawtext.h