Moving testroot into lb wrapper itself.
[debian-live-build.git] / Makefile
blob5374e0205fb53dbb0bcf6a18fe58d19e966758dd
1 # Makefile
3 SHELL := sh -e
5 LANGUAGES = $(shell cd manpages/po && ls)
7 SCRIPTS = frontend/cli/* frontend/cgi/live-build-cgi frontend/cgi/live-build-cgi.cron functions/* examples/auto/* examples/hooks/* scripts/*.sh scripts/*/* share/bin/* share/hooks/*
9 all: build
11 test:
12 @echo -n "Checking for syntax errors"
14 @for SCRIPT in $(SCRIPTS); \
15 do \
16 sh -n $${SCRIPT}; \
17 echo -n "."; \
18 done
20 @echo " done."
22 @echo -n "Checking for bashisms"
24 @if [ -x /usr/bin/checkbashisms ]; \
25 then \
26 for SCRIPT in $(SCRIPTS); \
27 do \
28 checkbashisms -f -x $${SCRIPT}; \
29 echo -n "."; \
30 done; \
31 else \
32 echo "WARNING: skipping bashism test - you need to install devscripts."; \
35 @echo " done."
37 build:
38 @echo "Nothing to build."
40 install:
41 # Installing shared data
42 mkdir -p $(DESTDIR)/usr/share/live/build
43 cp -r frontend/cgi data functions templates VERSION $(DESTDIR)/usr/share/live/build
44 cp -r share/* $(DESTDIR)/usr/share/live/build
46 # Installing executables
47 mkdir -p $(DESTDIR)/usr/bin
48 cp -a frontend/cli/* $(DESTDIR)/usr/bin
50 mkdir -p $(DESTDIR)/usr/lib/live
51 cp -a scripts/* $(DESTDIR)/usr/lib/live
52 cp -a components/* $(DESTDIR)/usr/lib/live/build
54 # Installing documentation
55 mkdir -p $(DESTDIR)/usr/share/doc/live-build
56 cp -r COPYING examples $(DESTDIR)/usr/share/doc/live-build
58 # Installing manpages
59 for MANPAGE in manpages/en/*; \
60 do \
61 SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
62 install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE}); \
63 done
65 for LANGUAGE in $(LANGUAGES); \
66 do \
67 for MANPAGE in manpages/$${LANGUAGE}/*; \
68 do \
69 SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \
70 install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
71 done; \
72 done
74 uninstall:
75 # Uninstalling shared data
76 rm -rf $(DESTDIR)/usr/share/live/build
77 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/live > /dev/null 2>&1 || true
79 # Uninstalling executables
80 rm -f $(DESTDIR)/usr/bin/lb $(DESTDIR)/usr/bin/live-build
82 # Uninstalling documentation
83 rm -rf $(DESTDIR)/usr/share/doc/live-build
85 # Uninstalling manpages
86 for MANPAGE in manpages/en/*; \
87 do \
88 SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
89 rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \
90 done
92 for LANGUAGE in $(LANGUAGES); \
93 do \
94 for MANPAGE in manpages/$${LANGUAGE}/*; \
95 do \
96 SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \
97 rm -f $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
98 done; \
99 done
101 clean:
103 distclean:
105 reinstall: uninstall install