-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
122 lines (105 loc) · 3.29 KB
/
Makefile
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Copyright (C) 2007-2016 emlix GmbH, see file AUTHORS
#
# This file is part of e2factory, the emlix embedded build system.
# For more information see http://www.e2factory.org
#
# e2factory is a registered trademark of emlix GmbH.
#
# e2factory 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.
SUBDIRS = lua generic global local plugins doc templates extensions
TOPLEVEL = .
include $(TOPLEVEL)/make.vars
CLEAN_FILES = *~ buildconfig.lua
.PHONY: all install install-local clean local localdist uninstall \
doc buildconfig.lua tags
help:
@cat INSTALL
.SILENT: buildconfig.lua
buildconfig.lua: Makefile make.vars
echo 'writing buildconfig.lua'
echo 'local buildconfig = {}' > $@
echo 'local strict = require("strict")' >>$@
echo 'buildconfig.PREFIX="$(PREFIX)"' >>$@
echo 'buildconfig.BINDIR="$(BINDIR)"' >>$@
echo 'buildconfig.LIBDIR="$(LIBDIR)"' >>$@
echo 'buildconfig.TOOLDIR="$(TOOLDIR)"' >>$@
echo 'buildconfig.SYSCONFDIR="$(SYSCONFDIR)"' >>$@
echo 'buildconfig.E2="$(E2)"' >>$@
echo 'buildconfig.LUA="$(LUA)"' >>$@
echo 'buildconfig.MAKE="$(MAKE)"' >> $@
echo 'buildconfig.MAJOR="$(MAJOR)"' >>$@
echo 'buildconfig.MINOR="$(MINOR)"' >>$@
echo 'buildconfig.PATCHLEVEL="$(PATCHLEVEL)"' >>$@
echo 'buildconfig.EXTRAVERSION="$(EXTRAVERSION)"' >>$@
echo 'buildconfig.VERSION="$(VERSION)"' >>$@
echo 'buildconfig.VERSIONSTRING="$(VERSIONSTRING)"' >>$@
echo 'buildconfig.GLOBAL_INTERFACE_VERSION={' >>$@
for x in $(GLOBAL_INTERFACE_VERSION) ; do \
echo " \"$$x\"," ; done >>$@
echo '}' >>$@
echo 'buildconfig.SYNTAX={' >>$@
for x in $(SYNTAX) ; do echo " \"$$x\"," ; done >>$@
echo '}' >>$@
echo 'return strict.lock(buildconfig)' >>$@
all: buildconfig.lua
for s in $(SUBDIRS) ; do \
$(MAKE) -C $$s $@ ;\
done
@echo "Build successful!"
install: all
install -d $(DESTDIR)$(LIBDIR)
install -m 644 buildconfig.lua $(DESTDIR)$(LIBDIR)
for s in $(SUBDIRS) ; do \
$(MAKE) -C $$s $@ ;\
done
@echo "Installation successful!"
uninstall:
for s in $(SUBDIRS) ; do \
$(MAKE) -C $$s $@ ;\
done
rm -f $(DESTDIR)$(LIBDIR)/buildconfig.lua
rmdir -p $(DESTDIR)$(LIBDIR) || true
rmdir -p $(DESTDIR)$(DOCDIR) || true
local: buildconfig.lua
for s in $(SUBDIRS) ; do \
$(MAKE) -C $$s $@ ;\
done
install-local: local
$(BINDIR)/e2-locate-project-root
@echo removing old installation...
rm -rf $(LOCALBINDIR)
rm -rf $(LOCALLIBDIR)
rm -rf $(LOCALMAKDIR)
rm -rf $(LOCALDOCDIR)
@echo removing old plugins...
rm -rf $(LOCALPLUGINDIR)
install -d $(LOCALLIBDIR)
install -m 644 buildconfig.lua $(LOCALLIBDIR)
for s in $(SUBDIRS) ; do \
$(MAKE) -C $$s $@ ;\
done
doc:
for s in $(SUBDIRS) ; do \
$(MAKE) -C $$s $@ ;\
done
install-doc:
install -d -m 755 $(DESTDIR)$(DOCDIR)
install -m 644 Changelog $(DESTDIR)$(DOCDIR)/
for s in $(SUBDIRS) ; do \
$(MAKE) -C $$s $@ ;\
done
clean:
rm -f $(CLEAN_FILES)
for s in $(SUBDIRS) ; do \
$(MAKE) -C $$s $@ ;\
done
showtag:
@echo $(TAG)