Transforming link targets so they work after the mount was moved (Closes: #702421).
[debian-live-boot.git] / Makefile
blobd08302751c9505055d23237ad91fef02e04edc87
1 # Makefile
3 SHELL := sh -e
5 LANGUAGES = $(shell cd manpages/po && ls)
7 SCRIPTS = backends/*/* bin/* scripts/*.sh scripts/*/*-*
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 @# We can't just fail yet on bashisms (FIXME)
23 @if [ -x "$$(which checkbashisms 2>/dev/null)" ]; \
24 then \
25 echo -n "Checking for bashisms"; \
26 for SCRIPT in $(SCRIPTS); \
27 do \
28 checkbashisms -f -x $${SCRIPT} || true; \
29 echo -n "."; \
30 done; \
31 echo " done."; \
32 else \
33 echo "W: checkbashisms - command not found"; \
34 echo "I: checkbashisms can be obtained from: "; \
35 echo "I: http://git.debian.org/?p=devscripts/devscripts.git"; \
36 echo "I: On Debian based systems, checkbashisms can be installed with:"; \
37 echo "I: apt-get install devscripts"; \
40 build:
41 @echo "Nothing to build."
43 install:
44 # Installing scripts
45 mkdir -p $(DESTDIR)/lib/live
46 cp -r scripts/boot.sh scripts/boot $(DESTDIR)/lib/live
48 # Installing executables
49 mkdir -p $(DESTDIR)/usr/share/initramfs-tools/hooks
50 cp backends/initramfs-tools/live.hook $(DESTDIR)/usr/share/initramfs-tools/hooks/live
51 mkdir -p $(DESTDIR)/usr/share/initramfs-tools/scripts
52 cp backends/initramfs-tools/live.script $(DESTDIR)/usr/share/initramfs-tools/scripts/live
54 # Installing docs
55 mkdir -p $(DESTDIR)/usr/share/doc/live-boot
56 cp -r COPYING $(DESTDIR)/usr/share/doc/live-boot
58 # Installing manpages
59 for MANPAGE in manpages/en/*; \
60 do \
61 SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
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} | sed -e 's|\.|\n|g' | tail -n1)"; \
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 executables
76 rm -f $(DESTDIR)/sbin/live-swapfile
77 rmdir --ignore-fail-on-non-empty $(DESTDIR)/sbin > /dev/null 2>&1 || true
79 rm -f $(DESTDIR)/usr/share/initramfs-tools/hooks/live
80 rm -f $(DESTDIR)/usr/share/initramfs-tools/scripts/live
82 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools/hooks > /dev/null 2>&1 || true
83 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools/scripts > /dev/null 2>&1 || true
84 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools > /dev/null 2>&1 || true
85 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share > /dev/null 2>&1 || true
86 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr > /dev/null 2>&1 || true
88 # Uninstalling docs
89 rm -rf $(DESTDIR)/usr/share/doc/live-boot
90 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/doc > /dev/null 2>&1 || true
91 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share > /dev/null 2>&1 || true
92 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr > /dev/null 2>&1 || true
94 # Uninstalling manpages
95 for MANPAGE in manpages/en/*; \
96 do \
97 SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
98 rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \
99 done
101 for LANGUAGE in $(LANGUAGES); \
102 do \
103 for MANPAGE in manpages/$${LANGUAGE}/*; \
104 do \
105 SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
106 rm -f $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
107 done; \
108 done
110 for SECTION in $(for MANPAGE in $(ls manpages/en/*); do basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1; done | sort -u); \
111 do \
112 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man/man$${SECTION} > /dev/null 2>&1 || true; \
113 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man/*/man$${SECTION} > /dev/null 2>&1 || true; \
114 done
116 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man > /dev/null 2>&1 || true
117 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share > /dev/null 2>&1 || true
118 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr > /dev/null 2>&1 || true
120 rmdir --ignore-fail-on-non-empty $(DESTDIR) > /dev/null 2>&1 || true
122 clean:
123 @echo "Nothing to clean."
125 distclean: clean
126 @echo "Nothing to distclean."
128 reinstall: uninstall install