2007-09-23 08:05:09 +00:00
|
|
|
# Makefile
|
2007-09-23 08:04:20 +00:00
|
|
|
|
2009-04-26 07:11:42 +00:00
|
|
|
SHELL := sh -e
|
|
|
|
|
2011-06-03 08:55:03 +00:00
|
|
|
LANGUAGES = $(shell cd manpages/po && ls)
|
2007-09-23 08:05:09 +00:00
|
|
|
|
2012-07-19 00:53:28 +00:00
|
|
|
SCRIPTS = bin/* frontends/cgi/live-build-cgi frontends/cgi/live-build-cgi.cron functions/* examples/*/*.sh examples/auto/* scripts/*.sh scripts/*/* share/hooks/*
|
2010-05-24 20:11:06 +00:00
|
|
|
|
2010-12-06 14:13:27 -01:00
|
|
|
all: build
|
2007-09-23 08:04:20 +00:00
|
|
|
|
2007-09-23 08:04:51 +00:00
|
|
|
test:
|
2010-05-23 10:26:15 +00:00
|
|
|
@echo -n "Checking for syntax errors"
|
|
|
|
|
2010-05-24 20:11:06 +00:00
|
|
|
@for SCRIPT in $(SCRIPTS); \
|
2007-09-23 08:04:51 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
sh -n $${SCRIPT}; \
|
2010-05-23 10:26:15 +00:00
|
|
|
echo -n "."; \
|
2007-09-23 08:04:51 +00:00
|
|
|
done
|
|
|
|
|
2010-05-23 10:26:15 +00:00
|
|
|
@echo " done."
|
|
|
|
|
|
|
|
@echo -n "Checking for bashisms"
|
|
|
|
|
|
|
|
@if [ -x /usr/bin/checkbashisms ]; \
|
2007-11-13 09:28:23 -01:00
|
|
|
then \
|
2010-05-24 20:11:06 +00:00
|
|
|
for SCRIPT in $(SCRIPTS); \
|
2010-05-23 10:26:15 +00:00
|
|
|
do \
|
2011-08-08 18:59:45 +00:00
|
|
|
checkbashisms -f -x $${SCRIPT}; \
|
2010-05-23 10:26:15 +00:00
|
|
|
echo -n "."; \
|
|
|
|
done; \
|
2007-11-13 09:28:23 -01:00
|
|
|
else \
|
2009-05-02 06:51:22 +00:00
|
|
|
echo "WARNING: skipping bashism test - you need to install devscripts."; \
|
2007-11-13 09:28:23 -01:00
|
|
|
fi
|
|
|
|
|
2010-05-23 10:26:15 +00:00
|
|
|
@echo " done."
|
|
|
|
|
2007-09-23 08:05:09 +00:00
|
|
|
build:
|
|
|
|
@echo "Nothing to build."
|
|
|
|
|
2008-08-25 12:47:41 +00:00
|
|
|
install:
|
2007-09-23 08:04:46 +00:00
|
|
|
# Installing shared data
|
2010-08-14 18:29:05 +00:00
|
|
|
mkdir -p $(DESTDIR)/usr/share/live/build
|
2012-06-05 18:25:23 +00:00
|
|
|
cp -r frontends/cgi data examples functions scripts includes package-lists templates VERSION $(DESTDIR)/usr/share/live/build
|
2011-07-18 13:10:24 +00:00
|
|
|
cp -r share/* $(DESTDIR)/usr/share/live/build
|
2009-11-22 12:40:20 -01:00
|
|
|
|
|
|
|
# Installing executables
|
|
|
|
mkdir -p $(DESTDIR)/usr/bin
|
2012-07-19 00:53:28 +00:00
|
|
|
cp -a bin/* $(DESTDIR)/usr/bin
|
2007-09-23 08:04:20 +00:00
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Installing documentation
|
2010-08-14 18:29:05 +00:00
|
|
|
mkdir -p $(DESTDIR)/usr/share/doc/live-build
|
|
|
|
cp -r COPYING docs/* $(DESTDIR)/usr/share/doc/live-build
|
2007-09-23 08:04:40 +00:00
|
|
|
|
2007-09-23 08:04:47 +00:00
|
|
|
# Installing manpages
|
2010-05-08 11:49:47 +00:00
|
|
|
for MANPAGE in manpages/en/*; \
|
2007-09-23 08:04:51 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
|
2010-05-24 11:58:08 +00:00
|
|
|
install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE}); \
|
2007-09-23 08:04:51 +00:00
|
|
|
done
|
|
|
|
|
2010-05-08 11:49:47 +00:00
|
|
|
for LANGUAGE in $(LANGUAGES); \
|
2007-09-23 08:04:51 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
for MANPAGE in manpages/$${LANGUAGE}/*; \
|
2007-09-23 08:05:09 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \
|
|
|
|
install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
|
2007-09-23 08:05:09 +00:00
|
|
|
done; \
|
2007-09-23 08:04:51 +00:00
|
|
|
done
|
2007-09-23 08:04:47 +00:00
|
|
|
|
2007-09-23 08:04:20 +00:00
|
|
|
uninstall:
|
2007-09-23 08:04:46 +00:00
|
|
|
# Uninstalling shared data
|
2010-08-14 18:29:05 +00:00
|
|
|
rm -rf $(DESTDIR)/usr/share/live/build
|
2011-08-31 09:17:13 +00:00
|
|
|
rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/live > /dev/null 2>&1 || true
|
2009-11-22 12:40:20 -01:00
|
|
|
|
|
|
|
# Uninstalling executables
|
2010-09-02 11:22:22 +00:00
|
|
|
rm -f $(DESTDIR)/usr/bin/lb $(DESTDIR)/usr/bin/live-build
|
2007-09-23 08:04:22 +00:00
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Uninstalling documentation
|
2010-08-14 18:29:05 +00:00
|
|
|
rm -rf $(DESTDIR)/usr/share/doc/live-build
|
2007-09-23 08:04:20 +00:00
|
|
|
|
2007-09-23 08:04:47 +00:00
|
|
|
# Uninstalling manpages
|
2010-05-08 11:49:47 +00:00
|
|
|
for MANPAGE in manpages/en/*; \
|
2007-09-23 08:04:47 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
|
|
|
|
rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \
|
2007-09-23 08:04:47 +00:00
|
|
|
done
|
|
|
|
|
2010-05-08 11:49:47 +00:00
|
|
|
for LANGUAGE in $(LANGUAGES); \
|
2007-09-23 08:04:47 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
for MANPAGE in manpages/$${LANGUAGE}/*; \
|
2007-09-23 08:05:09 +00:00
|
|
|
do \
|
2010-05-08 11:49:47 +00:00
|
|
|
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \
|
|
|
|
rm -f $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
|
2007-09-23 08:05:09 +00:00
|
|
|
done; \
|
2007-09-23 08:04:47 +00:00
|
|
|
done
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
clean:
|
2007-09-23 08:04:40 +00:00
|
|
|
|
2007-09-23 08:04:51 +00:00
|
|
|
distclean:
|
|
|
|
|
|
|
|
reinstall: uninstall install
|