-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (30 loc) · 956 Bytes
/
Makefile
File metadata and controls
47 lines (30 loc) · 956 Bytes
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
OBJS=src/lm.o
TESTOBJS=tests/tests.o
CIVETWEB_DIR=../civetweb
WEBOBJS=view/web.o view/file.o view/folder.o
CIVETWEB_LIB = $(CIVETWEB_DIR)/libcivetweb.a
all: lm.a tests.exe liblm.so web.exe
clean:
rm -f $(OBJS) $(WEBOBJS) $(TESTOBJS) lm.a liblm.so tests.exe web.exe
COPTS=-O0 -g -fPIC
#-fprofile-arcs -ftest-coverage
#COPTS=-O3 -Wall
CPPOPTS=-O0 -g -Wall -ggdb3 -fPIC -I./src -I$(CIVETWEB_DIR)/include
#-fprofile-arcs -ftest-coverage
.PHONY:
%.o: %.c
gcc -c $^ -o $@ -I. -Iapi $(COPTS)
%.o: %.cc
g++ -c $^ -o $@ $(CPPOPTS)
view/folder.o: view/folder.png
cd view; ld -r -b binary -o folder.o folder.png
view/file.o: view/file.png
cd view; ld -r -b binary -o file.o file.png
tests.exe: $(TESTOBJS) lm.a
g++ $^ -lrt -ldl -pthread -o $@ $(CPPOPTS) -I./src lm.a
liblm.so: $(OBJS)
g++ -shared $(OBJS) -o liblm.so
lm.a: $(OBJS)
ar -r lm.a $(OBJS)
web.exe: $(WEBOBJS) lm.a
g++ $^ -o $@ $(CPPOPTS) lm.a $(CIVETWEB_LIB) -lrt -ldl -pthread