-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
31 lines (22 loc) · 1.05 KB
/
makefile
File metadata and controls
31 lines (22 loc) · 1.05 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
ERROR_FLAGS=-Wall -Wextra -Wshadow -Wstrict-aliasing -ansi -pedantic -Werror
CPP_ERROR_FLAGS=${ERROR_FLAGS} -Weffc++
lib: libmodule_loader.a
test: lib libgreeter.so libclass_greeter.so main.o
g++ test/lib/main.o -Llib -lmodule_loader -ldl -o test/bin/test
rm test/lib/main.o
LD_LIBRARY_PATH=test/lib test/bin/test
clean:
rm -f lib/* test/lib/* test/bin/*
libmodule_loader.a: module_entry.o module_loader.o
ar rcs lib/libmodule_loader.a lib/module_entry.o lib/module_loader.o
rm lib/*.o
module_entry.o:
g++ ${CPP_ERROR_FLAGS} -std=c++14 -O -c src/module_entry.cpp -o lib/module_entry.o
module_loader.o: module_entry.o
g++ ${CPP_ERROR_FLAGS} -std=c++14 -O -Iinclude -c src/module_loader.cpp -o lib/module_loader.o
libgreeter.so:
gcc ${ERROR_FLAGS} -fPIC -shared test/src/greeter.c -o test/lib/libgreeter.so
libclass_greeter.so:
g++ ${CPP_ERROR_FLAGS} -std=c++14 -fPIC -shared -Itest/include test/src/class_greeter.cpp -o test/lib/libclass_greeter.so
main.o:
g++ ${CPP_ERROR_FLAGS} -std=c++14 -O -Iinclude -Itest/include -c test/src/main.cpp -o test/lib/main.o