5 LANGUAGES = en $(shell cd manpages/po && ls)
7 SCRIPTS = bin/* hooks/* scripts/live scripts/live-functions scripts/live-helpers scripts/*/*
12 @echo -n "Checking for syntax errors"
14 @for SCRIPT in $(SCRIPTS); \
22 @# We can't just fail yet on bashisms (FIXME)
23 @if [ -x "$$(which checkbashisms 2>/dev/null)" ]; \
25 echo -n "Checking for bashisms"; \
26 for SCRIPT in $(SCRIPTS); \
28 checkbashisms -f -x $${SCRIPT} || true; \
33 echo "W: checkbashisms - command not found"; \
34 echo "I: checkbashisms can be optained from: "; \
35 echo "I: http://git.debian.org/?p=devscripts/devscripts.git"; \
36 echo "I: On Debian systems, checkbashisms can be installed with:"; \
37 echo "I: apt-get install devscripts"; \
41 @echo "Nothing to build."
44 # Installing executables
45 mkdir -p $(DESTDIR)/sbin
46 cp bin/live-new-uuid bin/live-snapshot bin/live-swapfile $(DESTDIR)/sbin
48 mkdir -p $(DESTDIR)/usr/share/live-boot
49 cp bin/live-preseed bin/live-reconfigure local/languagelist $(DESTDIR)/usr/share/live-boot
51 mkdir -p $(DESTDIR)/usr/share/initramfs-tools
52 cp -r hooks scripts $(DESTDIR)/usr/share/initramfs-tools
55 mkdir -p $(DESTDIR)/usr/share/doc/live-boot
56 cp -r COPYING docs/* $(DESTDIR)/usr/share/doc/live-boot
58 mkdir -p $(DESTDIR)/usr/share/doc/live-boot/examples
59 cp -r etc/* $(DESTDIR)/usr/share/doc/live-boot/examples
63 for MANPAGE in manpages/en/*; \
65 SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
66 install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE}); \
70 # Uninstalling executables
71 rm -f $(DESTDIR)/sbin/live-snapshot $(DESTDIR)/sbin/live-swapfile
72 rmdir --ignore-fail-on-non-empty $(DESTDIR)/sbin
74 rm -rf $(DESTDIR)/usr/share/live-boot
76 rm -f $(DESTDIR)/usr/share/initramfs-tools/hooks/live
77 rm -rf $(DESTDIR)/usr/share/initramfs-tools/scripts/live*
78 rm -f $(DESTDIR)/usr/share/initramfs-tools/scripts/local-top/live
80 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools/hooks
81 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools/scripts/local-top
82 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools/scripts
83 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools
84 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share
85 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr
88 rm -rf $(DESTDIR)/usr/share/doc/live-boot
89 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/doc
90 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share
91 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr
93 # Uninstalling manpages
94 for MANPAGE in manpages/en/*; \
96 SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
97 rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \
100 for LANGUAGE in $(LANGUAGES); \
102 for MANPAGE in manpages/$${LANGUAGE}/*; \
104 SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \
105 rm -f $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
109 for SECTION in $(ls manpages/en/* | awk -F. '{ print $2 }'); \
111 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man/man$${SECTION} || true; \
112 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man/*/man$${SECTION} || true; \
115 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man || true
116 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share || true
117 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr || true
119 rmdir --ignore-fail-on-non-empty $(DESTDIR) || true
122 @echo "Nothing to clean."
125 @echo "Nothing to distclean."
127 reinstall: uninstall install