forked from adrianomelo/ldc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (63 loc) · 1.76 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
prefix=/usr
all: build
install: script
mkdir -p $(prefix)/share/ldc
mkdir -p $(prefix)/etc
mkdir -p $(prefix)/lib
cp bin/ldc-bin $(prefix)/bin/ldc-bin
cp src/pt_BR $(prefix)/share/ldc/pt_BR
cp src/ldc.conf $(prefix)/etc/ldc.conf
cp -P bin/*.so* $(prefix)/lib/
script:
mkdir -p $(prefix)/bin
@echo "#!/bin/bash" > $(prefix)/bin/ldc
@echo "export LIBC_FATAL_STDERR_=1" >> $(prefix)/bin/ldc
@echo "export LD_LIBRARY_PATH=$(prefix)/lib" >> $(prefix)/bin/ldc
@echo "$(prefix)/bin/ldc-bin \$$* 2> /dev/null" >> $(prefix)/bin/ldc
chmod a+x $(prefix)/bin/ldc
ifneq "$(prefix)" "/usr"
ln -sf $(prefix)/bin/ldc /usr/bin/ldc
endif
install_redhat:
cp -R scripts/redhat/* /etc/init.d/
/sbin/chkconfig --add ldc-daemon
install_librix:
cp -R scripts/librix/* /etc/init.d/
rc-update add ldc-daemon default
install_debian:
cp -R scripts/debian/* /etc/init.d/
sed -i 's|LDC_PREFIX|$(prefix)|g' /etc/init.d/ldc-daemon
update-rc.d ldc-daemon defaults
uninstall_debian:
update-rc.d -f ldc-daemon remove
uninstall:
rm -fr $(prefix)/bin/ldc*
rm -fr /usr/bin/ldc*
rm -fr $(prefix)/lib/libldc*
rm -fr $(prefix)/share/ldc
rm -fr /etc/init.d/ldc-*
clean:
rm -f bin/*so*
rm -f bin/ldc*
rm -f tests/bin/exec_*
rm -f tests/bin/test_*
rm -f *.cfg
rm -fr doc/Doxygen
@(cd src; make clean)
@(cd src/lib; make clean)
build:
@(cd src/lib; make build prefix=$(prefix);)
@(cd src; make build prefix=$(prefix))
test:
@(cd src/lib; make test;)
@(cd src; make test;)
@(export LD_LIBRARY_PATH=/usr/lib:bin:tests/bin; ./bin/ldc-bin)
@for i in `echo tests/bin/test*`; do \
if [ -f $$i ]; then \
(export LD_LIBRARY_PATH=/usr/lib:bin:tests/bin; ./$$i; echo ""); \
fi; \
done
docs:
doxygen doc/doxygen.conf;
cp -v doc/Doxygen/man/man3/* $(prefix)/share/man/man3/;