Dropping cdebootstrap support (Closes: #773657).
[debian-live-build.git] / Makefile
blobd79c79aacf963ab27f4f072dec97134ae2364478
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
53 # Installing documentation
54 mkdir -p $(DESTDIR)/usr/share/doc/live-build
55 cp -r COPYING examples $(DESTDIR)/usr/share/doc/live-build
57 # Installing manpages
58 for MANPAGE in manpages/en/*; \
59 do \
60 SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
61 install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE}); \
62 done
64 for LANGUAGE in $(LANGUAGES); \
65 do \
66 for MANPAGE in manpages/$${LANGUAGE}/*; \
67 do \
68 SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \
69 install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
70 done; \
71 done
73 uninstall:
74 # Uninstalling shared data
75 rm -rf $(DESTDIR)/usr/share/live/build
76 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/live > /dev/null 2>&1 || true
78 # Uninstalling executables
79 rm -f $(DESTDIR)/usr/bin/lb $(DESTDIR)/usr/bin/live-build
81 # Uninstalling documentation
82 rm -rf $(DESTDIR)/usr/share/doc/live-build
84 # Uninstalling manpages
85 for MANPAGE in manpages/en/*; \
86 do \
87 SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
88 rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \
89 done
91 for LANGUAGE in $(LANGUAGES); \
92 do \
93 for MANPAGE in manpages/$${LANGUAGE}/*; \
94 do \
95 SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \
96 rm -f $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
97 done; \
98 done
100 clean:
102 distclean:
104 reinstall: uninstall install