-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
58 lines (42 loc) · 1.44 KB
/
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
53
54
55
56
57
CC := gcc
CFLAGS := -I./include -Wall
CLIBS := -lidn2
SHELL = /bin/bash
OUTDIR = bin
DEPS = $(wildcard ./src/*.c)
HDEPS = $(wildcard ./include/*.h)
OBJS = cdict.o clist.o cstrlib.o url_parser.o cmdparser.o ctld.o libctld.o
LIBOBJS = cdict.o clist.o cstrlib.o libctld.o
OBJSTEST = cdict.o clist.o cstrlib.o libctld.o test.o
BINNAME=ctld
LIBNAME = libctld.so.1
ctld: dummy $(OBJS) $(HDEPS)
$(CC) $(CFLAGS) $(addprefix bin/, $(OBJS)) -o bin/$(BINNAME) $(CLIBS)
$(CC) -shared $(CFLAGS) $(addprefix bin/, $(LIBOBJS)) -Wl,-soname,$(LIBNAME) $ -o bin/$(LIBNAME)
test: dummy $(OBJSTEST) $(HDEPS) test.o
echo "Executing test rules...."
$(CC) $(CFLAGS) $(addprefix bin/, $(OBJSTEST)) -o bin/test $(CLIBS)
./bin/test
./test/test.sh
cdict.o: src/cdict.c include/cdict.h
$(CC) $(CFLAGS) -fPIC -c $< -o bin/$@
clist.o: src/clist.c include/clist.h
$(CC) $(CFLAGS) -fPIC -c $< -o bin/$@
libctld.o: src/libctld.c include/libctld.h
$(CC) $(CFLAGS) -fPIC -c $< $ -o bin/$@
cstrlib.o: src/cstrlib.c include/cstrlib.h
$(CC) $(CFLAGS) -fPIC -c $< -o bin/$@
url_parser.o: src/url_parser.c include/url_parser.h
$(CC) $(CFLAGS) -fPIC -c $< -o bin/$@
cmdparser.o: src/cmdparser.c include/cmdparser.h
$(CC) $(CFLAGS) -fPIC -c $< -o bin/$@
ctld.o: src/ctld.c include/libctld.h
$(CC) $(CFLAGS) -c $< -o bin/$@
test.o: test/test.c
$(CC) $(CFLAGS) -c $< -o bin/$@
dummy:
mkdir -p bin
xxd -i psl.dat > ./include/psl_data.h
.PHONY: clean
clean:
rm -f bin/$(BINNAME) bin/*.o