-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (36 loc) · 1003 Bytes
/
Makefile
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
# libpatterns Makefile
# Charlotte Koch <[email protected]>
LIBDIR?= ${DESTDIR}${PREFIX}/lib
MANDIR?= ${DESTDIR}${PREFIX}/man/man7
INCLUDEDIR?= ${DESTDIR}${PREFIX}/include
OBJS= libpatterns.a libpatterns.so
.PHONY: all
all: ${OBJS}
.SUFFIXES: .c .o
.c.o:
${CC} ${CPPFLAGS} ${CFLAGS} -c -fPIC -o ${.TARGET} ${.ALLSRC}
libpatterns.a: patterns.o
${AR} crs ${.TARGET} ${.ALLSRC}
libpatterns.so: patterns.o
${CC} -shared -o ${.TARGET} ${LDFLAGS} ${.ALLSRC}
.PHONY: install
install: install-man install-headers install-static install-shared
.PHONY: install-man
install-man:
install -d ${MANDIR}
install -m0644 patterns.7 ${MANDIR}
.PHONY: install-headers
install-headers:
install -d ${INCLUDEDIR}
install -m0644 patterns.h ${INCLUDEDIR}
.PHONY: install-static
install-static:
install -d ${LIBDIR}
install -m0644 libpatterns.a ${LIBDIR}
.PHONY: install-shared
install-shared:
install -d ${LIBDIR}
install -m0755 libpatterns.so ${LIBDIR}
.PHONY: clean
clean:
rm -f ${OBJS} *.o *.core