-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (30 loc) · 792 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
progobjs=\
test.o
libobjs=\
cmp.o \
haar.o \
sig.o
objects=$(progobjs) $(libobjs)
DEV_FLAGS=-fwrapv -pthread -fpic -g
PROD_FLAGS=-fwrapv -pthread -fpic -O2 -ffast-math
CFLAGS=$(PROF_FLAGS) $(DEV_FLAGS) -Dcimg_display=0
LIB_TARGET=/usr/local/lib
CXX=clang++
all: test testlib
install: CFLAGS=$(PROD_FLAGS) -Dcimg_display=0
install: lib
cp libseek.so $(LIB_TARGET)
ln -s $(LIB_TARGET)/libseek.so /usr/lib/libseek.so # fuck autoconf
uninstall:
rm -f $(LIB_TARGET)/libseek.so
rm -f /usr/lib/libseek.so # fuck autoconf
testlib: lib test.o
$(CXX) -o $@ $(CFLAGS) test.o -L. -lseek
lib: $(libobjs)
$(CXX) -shared -o libseek.so $(libobjs)
test: $(objects)
$(CXX) -o $@ $(CFLAGS) $(objects)
%.o: %.cpp %.h
$(CXX) -o $@ -c $< $(CFLAGS)
clean:
rm -f $(objects) test testlib libseek.so