libdrawtext

annotate Makefile.in @ 29:03699346d59f

fixed the example makefiles
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 15 Apr 2014 05:49:05 +0300
parents df6d52b36bd6
children
rev   line source
nuclear@0 1 src = $(wildcard src/*.c)
nuclear@0 2 obj = $(src:.c=.o)
nuclear@0 3 dep = $(obj:.o=.d)
nuclear@0 4
nuclear@0 5 abi = 0
nuclear@26 6 rev = 2
nuclear@0 7
nuclear@0 8 lib_a = $(name).a
nuclear@0 9
nuclear@0 10 ifeq ($(shell uname -s), Darwin)
nuclear@0 11 lib_so = $(name).dylib
nuclear@0 12 sharedopt = -dynamiclib
nuclear@0 13
nuclear@0 14 libgl = -framework OpenGL -lGLEW
nuclear@0 15 else
nuclear@0 16 soname = $(name).so.$(abi)
nuclear@0 17 lib_so = $(soname).$(rev)
nuclear@10 18 linkname = $(name).so
nuclear@0 19 sharedopt = -shared -Wl,-soname,$(soname)
nuclear@0 20
nuclear@0 21 libgl = -lGL -lGLU -lGLEW
nuclear@0 22 endif
nuclear@0 23
nuclear@0 24 CC = gcc
nuclear@11 25 CFLAGS = -pedantic -Wall -g -fPIC -I$(PREFIX)/include $(ft2_cflags)
nuclear@11 26 LDFLAGS = -L$(PREFIX)/lib $(ft2_libs) $(libgl)
nuclear@0 27
nuclear@0 28 .PHONY: all
nuclear@0 29 all: $(lib_a) $(lib_so)
nuclear@0 30
nuclear@0 31 $(lib_a): $(obj)
nuclear@0 32 $(AR) rcs $@ $(obj)
nuclear@0 33
nuclear@0 34 $(lib_so): $(obj)
nuclear@0 35 $(CC) $(sharedopt) -o $@ $(obj) $(LDFLAGS)
nuclear@0 36
nuclear@0 37 -include $(dep)
nuclear@0 38
nuclear@0 39 %.d: %.c
nuclear@0 40 @$(CPP) $(CFLAGS) -MM $< >$@
nuclear@0 41
nuclear@22 42 .PHONY: cleanobj
nuclear@22 43 cleanobj:
nuclear@22 44 rm -f $(obj)
nuclear@0 45
nuclear@0 46 .PHONY: clean
nuclear@0 47 clean:
nuclear@0 48 rm -f $(obj) $(lib_a) $(lib_so)
nuclear@0 49
nuclear@0 50 .PHONY: cleandep
nuclear@0 51 cleandep:
nuclear@0 52 rm -f $(dep)
nuclear@0 53
nuclear@0 54 .PHONY: install
nuclear@0 55 install: $(lib_a) $(lib_so)
nuclear@0 56 mkdir -p $(PREFIX)/lib $(PREFIX)/include
nuclear@0 57 cp $(lib_a) $(PREFIX)/lib/$(lib_a)
nuclear@0 58 cp $(lib_so) $(PREFIX)/lib/$(lib_so)
nuclear@0 59 cp src/drawtext.h $(PREFIX)/include/drawtext.h
nuclear@12 60 [ -n "$(linkname)" ] && \
nuclear@12 61 rm -f $(PREFIX)/lib/$(linkname) $(PREFIX)/lib/$(soname) && \
nuclear@12 62 cd $(PREFIX)/lib && ln -s $(lib_so) $(linkname) && ln -s $(lib_so) $(soname) || true
nuclear@0 63
nuclear@0 64
nuclear@0 65 .PHONY: uninstall
nuclear@0 66 uninstall:
nuclear@0 67 rm -f $(PREFIX)/lib/$(lib_a)
nuclear@0 68 rm -f $(PREFIX)/lib/$(lib_so)
nuclear@11 69 rm -f $(PREFIX)/lib/$(linkname)
nuclear@11 70 rm -f $(PREFIX)/lib/$(soname)
nuclear@0 71 rm -f $(PREFIX)/include/drawtext.h
nuclear@22 72
nuclear@22 73
nuclear@22 74 .PHONY: both
nuclear@22 75 both:
nuclear@22 76 ./configure --disable-freetype
nuclear@22 77 $(MAKE) cleanobj
nuclear@22 78 $(MAKE)
nuclear@22 79 ./configure --enable-freetype
nuclear@22 80 $(MAKE) cleanobj
nuclear@22 81 $(MAKE)
nuclear@22 82
nuclear@22 83 .PHONY: both-install
nuclear@22 84 both-install:
nuclear@22 85 ./configure --disable-freetype
nuclear@22 86 $(MAKE) cleanobj
nuclear@22 87 $(MAKE) install
nuclear@22 88 ./configure --enable-freetype
nuclear@22 89 $(MAKE) cleanobj
nuclear@22 90 $(MAKE) install
nuclear@22 91 $(MAKE) cleanobj