summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-11-03 17:35:59 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-11-15 06:35:41 +0000
commitdebf16e6eba8ff1c55fe32ad391874916104ef6b (patch)
tree0c3cd25f1f7cf00ca8af3997e1a80cd8221e22b7 /Makefile
parentRemoving README in config trees. (diff)
downloadsystem-images-debf16e6eba8ff1c55fe32ad391874916104ef6b.tar.xz
system-images-debf16e6eba8ff1c55fe32ad391874916104ef6b.zip
Rewriting Makefile.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile110
1 files changed, 53 insertions, 57 deletions
diff --git a/Makefile b/Makefile
index c8bcfb7..12edc8c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,79 +1,75 @@
# Makefile
-## live-images(7) - System Image Configurations
-## Copyright (C) 2006-2014 Daniel Baumann <mail@daniel-baumann.ch>
-##
-## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
-## This is free software, and you are welcome to redistribute it
-## under certain conditions; see COPYING for details.
-
+# system-images - Debian based live and installer images
+# Copyright (C) 2006-2016 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
SHELL := sh -e
-SCRIPTS = images/*/auto/* images/*/config/hooks/*
+SOFTWARE = system-images
all: build
-test:
- @echo -n "Checking for syntax errors"
+build: share/man/*.txt
+ $(MAKE) -C share/man
+
+ sed -n '/^NAME/,$$p' share/man/$(SOFTWARE).7.txt > README.txt
+
+install: build
+ mkdir -p $(DESTDIR)/usr/share/doc/$(SOFTWARE)
+ cp -a README.txt $(DESTDIR)/usr/share/doc/$(SOFTWARE)
- @for SCRIPT in $(SCRIPTS); \
+ mkdir -p $(DESTDIR)/usr/share/$(SOFTWARE)
+ cp -a share/images/* $(DESTDIR)/usr/share/$(SOFTWARE)
+
+ for SECTION in $$(seq 1 8); \
do \
- sh -n $${SCRIPT}; \
- echo -n "."; \
+ if ls share/man/*.$${SECTION} > /dev/null 2>&1; \
+ then \
+ mkdir -p $(DESTDIR)/usr/share/man/man$${SECTION}; \
+ cp share/man/*.$${SECTION} $(DESTDIR)/usr/share/man/man$${SECTION}; \
+ fi; \
done
- @echo " done."
-
- @if [ -x "$$(which checkbashisms 2>/dev/null)" ]; \
- then \
- echo -n "Checking for bashisms"; \
- for SCRIPT in $(SCRIPTS); \
+uninstall:
+ for SECTION in $$(seq 1 8); \
+ do \
+ for FILE in share/man/*.$${SECTION}; \
do \
- checkbashisms -f -x $${SCRIPT}; \
- echo -n "."; \
+ if [ -e "$${FILE}" ]; \
+ then \
+ rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${FILE}); \
+ fi; \
done; \
- echo " done."; \
- else \
- echo "W: checkbashisms - command not found"; \
- echo "I: checkbashisms can be obtained from: "; \
- echo "I: http://git.debian.org/?p=devscripts/devscripts.git"; \
- echo "I: On Debian based systems, checkbashisms can be installed with:"; \
- echo "I: apt-get install devscripts"; \
- fi
-
-build:
- @echo "Nothing to build."
-
-install:
- # Installing image configurations
- mkdir -p $(DESTDIR)/usr/share/live
- cp -a images $(DESTDIR)/usr/share/live
-
- # Installing shared data
- for IMAGE in $(DESTDIR)/usr/share/live/images/*; do cp VERSION.txt $${IMAGE}/docs; done
-
- # Installing docs
- mkdir -p $(DESTDIR)/usr/share/doc/live-images
- cp -r COPYING $(DESTDIR)/usr/share/doc/live-images
-
-uninstall:
- # Uninstalling image configs
- rm -rf $(DESTDIR)/usr/share/live/images
- rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/live
+ rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/share/man/man$${SECTION} || true; \
+ done
- # Uninstalling docs
- rm -rf $(DESTDIR)/usr/share/doc/live-images
- rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/doc > /dev/null 2>&1 || true
- rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share > /dev/null 2>&1 || true
- rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr > /dev/null 2>&1 || true
+ rm -rf $(DESTDIR)/usr/share/$(SOFTWARE)/*
+ rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/share/$(SOFTWARE) || true
- rmdir --ignore-fail-on-non-empty $(DESTDIR) > /dev/null 2>&1 || true
+ rm -rf $(DESTDIR)/usr/share/doc/$(SOFTWARE)/*
+ rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/share/doc/$(SOFTWARE) || true
clean:
- @echo "Nothing to clean."
+ $(MAKE) -C share/man clean
+
+ rm -rf build
+ rm -f README.txt
distclean: clean
- @echo "Nothing to distclean."
reinstall: uninstall install
+
+.PHONY: build