-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
52 lines (40 loc) · 876 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
49
50
51
52
CC=gcc
CFLAGS+=-Wall -Wextra -O3 -c -g
O=o
LIB=libregexp9.a
RANLIB=true
LIB=libregexp9.a
OFILES=\
regcomp.$O\
regerror.$O\
regexec.$O\
regsub.$O\
regaux.$O\
rregexec.$O\
rregsub.$O\
utf.$O\
HFILES=\
regexp9.h\
regcomp.h\
utf.h\
all: $(LIB)
install: $(LIB)
mkdir -p $(PREFIX)/share/man/man3 $(PREFIX)/share/man/man7
install -m 0644 regexp9.3 $(PREFIX)/share/man/man3/regexp9.3
install -m 0644 regexp9.7 $(PREFIX)/share/man/man7/regexp9.7
mkdir -p $(PREFIX)/lib
install -m 0644 $(LIB) $(PREFIX)/lib/$(LIB)
mkdir -p $(PREFIX)/include
install -m 0644 regexp9.h $(PREFIX)/include/regexp9.h
test: test.$O $(LIB)
$(CC) -o test test.$O $(LIB)
test2: test2.$O $(LIB)
$(CC) -o test2 test2.$O $(LIB)
$(LIB): $(OFILES)
$(AR) $(ARFLAGS) $(LIB) $(OFILES)
$(RANLIB) $(LIB)
%.$O: %.c
$(CC) $(CFLAGS) $*.c
$(OFILES): $(HFILES)
clean:
rm -f $(OFILES) $(LIB)