source: live-build/trunk/fuentes/Makefile @ 900

Last change on this file since 900 was 900, checked in by kbut, 4 years ago

add original source

File size: 2.7 KB
Line 
1# Makefile
2
3SHELL := sh -e
4
5LANGUAGES = $(shell cd manpages/po && ls)
6
7SCRIPTS = bin/* frontends/cgi/live-build-cgi frontends/cgi/live-build-cgi.cron functions/* examples/auto/* examples/hooks/* scripts/*.sh scripts/*/* share/bin/* share/hooks/*
8
9all: build
10
11test:
12        @echo -n "Checking for syntax errors"
13
14        @for SCRIPT in $(SCRIPTS); \
15        do \
16                sh -n $${SCRIPT}; \
17                echo -n "."; \
18        done
19
20        @echo " done."
21
22        @echo -n "Checking for bashisms"
23
24        @if [ -x /usr/bin/checkbashisms ]; \
25        then \
26                for SCRIPT in $(SCRIPTS); \
27                do \
28                        checkbashisms -f -x $${SCRIPT}; \
29                        echo -n "."; \
30                done; \
31        else \
32                echo "WARNING: skipping bashism test - you need to install devscripts."; \
33        fi
34
35        @echo " done."
36
37build:
38        @echo "Nothing to build."
39
40install:
41        # Installing shared data
42        mkdir -p $(DESTDIR)/usr/share/live/build
43        cp -r frontends/cgi data functions templates VERSION $(DESTDIR)/usr/share/live/build
44        cp -r share/* $(DESTDIR)/usr/share/live/build
45
46        # Installing executables
47        mkdir -p $(DESTDIR)/usr/bin
48        cp -a bin/* $(DESTDIR)/usr/bin
49
50        mkdir -p $(DESTDIR)/usr/lib/live
51        cp -a scripts/* $(DESTDIR)/usr/lib/live
52
53        # Installing documentation
54        mkdir -p $(DESTDIR)/usr/share/doc/live-build
55        cp -r COPYING docs/* examples $(DESTDIR)/usr/share/doc/live-build
56
57        # Installing manpages
58        for MANPAGE in manpages/en/*; \
59        do \
60                SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
61                install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE}); \
62        done
63
64        for LANGUAGE in $(LANGUAGES); \
65        do \
66                for MANPAGE in manpages/$${LANGUAGE}/*; \
67                do \
68                        SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \
69                        install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
70                done; \
71        done
72
73uninstall:
74        # Uninstalling shared data
75        rm -rf $(DESTDIR)/usr/share/live/build
76        rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/live > /dev/null 2>&1 || true
77
78        # Uninstalling executables
79        rm -f $(DESTDIR)/usr/bin/lb $(DESTDIR)/usr/bin/live-build
80
81        # Uninstalling documentation
82        rm -rf $(DESTDIR)/usr/share/doc/live-build
83
84        # Uninstalling manpages
85        for MANPAGE in manpages/en/*; \
86        do \
87                SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
88                rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \
89        done
90
91        for LANGUAGE in $(LANGUAGES); \
92        do \
93                for MANPAGE in manpages/$${LANGUAGE}/*; \
94                do \
95                        SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \
96                        rm -f $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
97                done; \
98        done
99
100clean:
101
102distclean:
103
104reinstall: uninstall install
Note: See TracBrowser for help on using the repository browser.