-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile.in
105 lines (82 loc) · 2.24 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
src = $(wildcard src/*.c)
obj = $(src:.c=.o)
dep = $(obj:.o=.d)
abi = 0
rev = 5
lib_a = $(name).a
sodir = lib
sys := $(shell uname -s | sed 's/MINGW.*/mingw/')
ifeq ($(sys), Darwin)
lib_so = $(name).dylib
sharedopt = -dynamiclib
libgl = -framework OpenGL
else ifeq ($(sys), mingw)
lib_so = $(name).dll
sharedopt = -shared
sodir = bin
libgl = -lopengl32 -lglu32
else
soname = $(name).so.$(abi)
lib_so = $(soname).$(rev)
ldname = $(name).so
sharedopt = -shared -Wl,-soname,$(soname)
libgl = -lGL -lGLU
endif
CFLAGS = -pedantic -Wall $(opt) $(dbg) -fPIC -fcommon -I$(PREFIX)/include $(ft2_cflags) -DUSE_THREADS
LDFLAGS = -L$(PREFIX)/lib $(ft2_libs) $(libgl) -lpthread
.PHONY: all
all: $(lib_a) $(lib_so) $(soname) $(ldname)
$(lib_a): $(obj)
$(AR) rcs $@ $(obj)
$(lib_so): $(obj)
$(CC) $(sharedopt) -o $@ $(obj) $(LDFLAGS)
[ -n "$(ldname)" ] && \
rm -f $(soname) && ln -s $(lib_so) $(soname) && \
rm -f $(ldname) && ln -s $(soname) $(ldname) || \
true
-include $(dep)
%.d: %.c
@$(CPP) $(CFLAGS) -MM $< >$@
.PHONY: cleanobj
cleanobj:
rm -f $(obj)
.PHONY: clean
clean:
rm -f $(obj) $(lib_a) $(lib_so)
.PHONY: cleandep
cleandep:
rm -f $(dep)
.PHONY: install
install: $(lib_a) $(lib_so)
mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/lib $(DESTDIR)$(PREFIX)/include
cp $(lib_a) $(DESTDIR)$(PREFIX)/lib/$(lib_a)
cp $(lib_so) $(DESTDIR)$(PREFIX)/$(sodir)/$(lib_so)
cp src/drawtext.h $(DESTDIR)$(PREFIX)/include/drawtext.h
[ -n "$(ldname)" ] && \
rm -f $(DESTDIR)$(PREFIX)/$(sodir)/$(ldname) $(DESTDIR)$(PREFIX)/$(sodir)/$(soname) && \
cd $(DESTDIR)$(PREFIX)/lib && ln -s $(lib_so) $(ldname) && ln -s $(lib_so) $(soname) || true
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(PREFIX)/include/drawtext.h
rm -f $(DESTDIR)$(PREFIX)/lib/$(lib_a)
rm -f $(DESTDIR)$(PREFIX)/$(sodir)/$(lib_so)
[ -n "$(ldname)" ] && \
rm -f $(DESTDIR)$(PREFIX)/$(sodir)/$(ldname) && \
rm -f $(DESTDIR)$(PREFIX)/$(sodir)/$(soname) || true
.PHONY: both
both:
./configure --disable-freetype
$(MAKE) cleanobj
$(MAKE)
./configure --enable-freetype
$(MAKE) cleanobj
$(MAKE)
.PHONY: both-install
both-install:
./configure --disable-freetype
$(MAKE) cleanobj
$(MAKE) install
./configure --enable-freetype
$(MAKE) cleanobj
$(MAKE) install
$(MAKE) cleanobj