-
Notifications
You must be signed in to change notification settings - Fork 10
/
makefile
41 lines (32 loc) · 1.26 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
# STANDARD MAKEFILE FOR CHL
# https://github.com/it4e/CHL
install: move_files
# Put files in proper locations
move_files: create_lib
mv libchl.so /usr/lib/chl/
cp core/*.h /usr/include/chl
# Move plugin dependent libraries and headers
if [ "${PLUGINS}" != "FALSE" ]; then bash findplugindeps plugins; fi
# Make CHL libs available
ln -f -s /usr/lib/chl/* /usr/lib/
# Create library
create_lib: create_path compile_core
gcc -shared -o libchl.so cmp/*.o
make clean
# Handle compilation of core
compile_core: compile_plugins
if [ "${TYPE}" != "FCGI" ]; then gcc -std=c11 -c -Wall -Werror -fPIC core/src/*.c; mv *.o cmp; else gcc -std=c11 -c -D '_F_CHL_' -Wall -Werror -fPIC core/src/*.c; mv *.o cmp; fi # Check whether to compile as fcgi or cgi
# Handle plugins compilation
compile_plugins:
# Check whether to compile plugins or not
if [ "${PLUGINS}" != "FALSE" ]; then bash pluginhandler plugins; fi
# Create path for compilation and library
create_path:
# Check whether library paths already exists
if ! [ -d "/usr/lib/chl" ]; then mkdir /usr/lib/chl; fi
if ! [ -d "/usr/include/chl" ]; then mkdir /usr/include/chl; fi
# Check whether compilation folder already exists
if ! [ -d "cmp" ]; then mkdir cmp; fi
# Clean cmp
clean:
if [ -d "cmp" ]; then rm -r cmp; fi