summaryrefslogtreecommitdiffstats
path: root/system-build/Makefile
blob: 71ec0f2e4e472068010313709830d6fb40a4f2b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Makefile

SHELL := sh -e

SCRIPTS = frontend/* functions/* examples/auto/* examples/hooks/* scripts/*.sh scripts/*/* share/bin/* share/hooks/*/*

all: build

test:
	@echo -n "Checking for syntax errors"

	@for SCRIPT in $(SCRIPTS); \
	do \
		sh -n $${SCRIPT}; \
		echo -n "."; \
	done

	@echo " done."

	@echo -n "Checking for bashisms"

	@if [ -x /usr/bin/checkbashisms ]; \
	then \
		for SCRIPT in $(SCRIPTS); \
		do \
			checkbashisms -f -x $${SCRIPT}; \
			echo -n "."; \
		done; \
	else \
		echo "WARNING: skipping bashism test - you need to install devscripts."; \
	fi

	@echo " done."

build:
	@echo "Nothing to build."

install:
	# Installing shared data
	mkdir -p $(DESTDIR)/usr/share/live/build
	cp -r data functions VERSION.txt $(DESTDIR)/usr/share/live/build
	cp -r share/* $(DESTDIR)/usr/share/live/build

	# Installing executables
	mkdir -p $(DESTDIR)/usr/bin
	cp -a frontend/* $(DESTDIR)/usr/bin

	mkdir -p $(DESTDIR)/usr/lib/live
	cp -a scripts/* $(DESTDIR)/usr/lib/live

	# Installing documentation
	mkdir -p $(DESTDIR)/usr/share/doc/live-build
	cp -r LICENSE.txt examples $(DESTDIR)/usr/share/doc/live-build

uninstall:
	# Uninstalling shared data
	rm -rf $(DESTDIR)/usr/share/live/build
	rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/live > /dev/null 2>&1 || true

	# Uninstalling executables
	rm -f $(DESTDIR)/usr/bin/lb $(DESTDIR)/usr/bin/live-build

	# Uninstalling documentation
	rm -rf $(DESTDIR)/usr/share/doc/live-build

clean:

distclean:

reinstall: uninstall install