Releasing debian version 4.0~alpha21-1.
[debian-live-boot.git] / Makefile
blobe3f394642da7fd21f0a32aa0ed1932941bc13d8e
1 # Makefile
3 SHELL := sh -e
5 LANGUAGES = $(shell cd manpages/po && ls)
7 SCRIPTS = backend/*/* frontend/* components/*
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 components
45 mkdir -p $(DESTDIR)/lib/live/boot
46 cp components/* $(DESTDIR)/lib/live/boot
48 # Installing executables
49 mkdir -p $(DESTDIR)/usr/share/initramfs-tools/hooks
50 cp backend/initramfs-tools/live.hook $(DESTDIR)/usr/share/initramfs-tools/hooks/live
51 mkdir -p $(DESTDIR)/usr/share/initramfs-tools/scripts
52 cp backend/initramfs-tools/live.script $(DESTDIR)/usr/share/initramfs-tools/scripts/live
54 mkdir -p $(DESTDIR)/bin
55 cp frontend/* $(DESTDIR)/bin
57 # Installing docs
58 mkdir -p $(DESTDIR)/usr/share/doc/live-boot
59 cp -r COPYING $(DESTDIR)/usr/share/doc/live-boot
61 # Installing manpages
62 for MANPAGE in manpages/en/*; \
63 do \
64 SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
65 install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE}); \
66 done
68 for LANGUAGE in $(LANGUAGES); \
69 do \
70 for MANPAGE in manpages/$${LANGUAGE}/*; \
71 do \
72 SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
73 install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
74 done; \
75 done
77 uninstall:
78 # Uninstalling executables
79 rm -f $(DESTDIR)/bin/live-boot
80 rm -f $(DESTDIR)/bin/live-swapfile
81 rmdir --ignore-fail-on-non-empty $(DESTDIR)/bin > /dev/null 2>&1 || true
83 rm -f $(DESTDIR)/usr/share/initramfs-tools/hooks/live
84 rm -f $(DESTDIR)/usr/share/initramfs-tools/scripts/live
86 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools/hooks > /dev/null 2>&1 || true
87 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools/scripts > /dev/null 2>&1 || true
88 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools > /dev/null 2>&1 || true
89 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share > /dev/null 2>&1 || true
90 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr > /dev/null 2>&1 || true
92 # Uninstalling docs
93 rm -rf $(DESTDIR)/usr/share/doc/live-boot
94 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/doc > /dev/null 2>&1 || true
95 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share > /dev/null 2>&1 || true
96 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr > /dev/null 2>&1 || true
98 # Uninstalling manpages
99 for MANPAGE in manpages/en/*; \
100 do \
101 SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
102 rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \
103 done
105 for LANGUAGE in $(LANGUAGES); \
106 do \
107 for MANPAGE in manpages/$${LANGUAGE}/*; \
108 do \
109 SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
110 rm -f $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
111 done; \
112 done
114 for SECTION in $(for MANPAGE in $(ls manpages/en/*); do basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1; done | sort -u); \
115 do \
116 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man/man$${SECTION} > /dev/null 2>&1 || true; \
117 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man/*/man$${SECTION} > /dev/null 2>&1 || true; \
118 done
120 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man > /dev/null 2>&1 || true
121 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share > /dev/null 2>&1 || true
122 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr > /dev/null 2>&1 || true
124 rmdir --ignore-fail-on-non-empty $(DESTDIR) > /dev/null 2>&1 || true
126 clean:
127 @echo "Nothing to clean."
129 distclean: clean
130 @echo "Nothing to distclean."
132 reinstall: uninstall install