-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
50 lines (40 loc) · 1.48 KB
/
Copy pathmakefile
File metadata and controls
50 lines (40 loc) · 1.48 KB
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
# This program is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License
objects = *.o
# Appending More Text to Variables
#objects += MainClient.o
CFLAGS = $(include_dir)
include_dir = -I./lib/inc/
INCDIR = lib/inc
SRCDIR = lib/src
# Extra flags to give to the C++ compiler
CXXFLAGS =
CDEBUG = -g
all : MainClient
# -L<library path> - specify a lib directory
# -l<library> - link with library lib<library>.a
# -dl pour dlopen, dlsym, dlclose
MainClient : libPrivate.so MainClient.o
gcc $(CDEBUG) -o MainClient MainClient.o -L. -lPrivate -ldl
# -o <name> - name of the output file
libPrivate.so: lib/src/PrivateTreatment.cpp lib/inc/PrivateTreatment.h
g++ $(CFLAGS) -c -o CTreatment.o $(SRCDIR)/CTreatment.cpp
g++ $(CFLAGS) -c -o CConfig.o $(SRCDIR)/CConfig.cpp
g++ $(CFLAGS) -c -o CMethod.o $(SRCDIR)/CMethod.cpp
g++ $(CFLAGS) -c -o PrivateTreatment.o lib/src/PrivateTreatment.cpp
g++ $(CFLAGS) -c -o CGraph.o lib/algo/CGraph.cpp
# Can build this shared object libPrivate.so
g++ -Wall -shared -fPIC -o libPrivate.so $(SRCDIR)/PrivateTreatment.cpp \
$(SRCDIR)/CTreatment.cpp $(SRCDIR)/CConfig.cpp $(SRCDIR)/CMethod.cpp
CTreatment.o : lib/src/CTreatment.cpp lib/inc/CTreatment.h
g++ -Wall -c $(SRCDIR)/CTreatment.cpp
install:
LD_LIBRARY_PATH=.
export LD_LIBRARY_PATH
# Avoid pb if a file named clean is ever created in this directory
.PHONY: clean
clean:
rm $(objects) *.so
rm MainClient
@echo 'suppression effectuee'