-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.top
54 lines (44 loc) · 1.4 KB
/
Makefile.top
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
top_srcdir =
top_builddir =
this_srcdir =
this_makefile = Makefile.local
all:
include project.mk
include config.mk
include user.mk
include $(this_makefile)
include makeshift/Makefile.common
config.mk user.mk:
touch $@
#####################################################
#
# Alternate build dir generation
#
#####################################################
BUILTIN_CONFIG_MK_SOURCES := $(wildcard makeshift/config.mk.*)
BUILTIN_CONFIGS := \
$(patsubst makeshift/config.mk.%,%,$(BUILTIN_CONFIG_MK_SOURCES))
BUILTIN_CONFIG_MK_DESTS := $(addsuffix /config.mk,$(BUILTIN_CONFIGS))
BUILTIN_CONFIG_MAKEFILES := $(addsuffix /Makefile,$(BUILTIN_CONFIGS))
$(BUILTIN_CONFIG_MK_DESTS): %/config.mk: makeshift/config.mk.%
@mkdir -p $*
rm -f $@
ln -s ../$< $@
$(BUILTIN_CONFIG_MAKEFILES): %/Makefile: $(top_srcdir)makeshift/Makefile.common
@mkdir -p $*
@echo '# This file is autogenerated. Do not edit it' > $@
@echo 'top_srcdir = ../' >> $@
@echo 'top_builddir = ' >> $@
@echo 'this_srcdir = ../' >> $@
@echo 'this_srcdir = ../' >> $@
@echo >> $@
@echo 'all:' >> $@
@echo >> $@
@echo 'include $$(top_srcdir)project.mk' >> $@
@echo 'include $$(top_builddir)config.mk' >> $@
@echo 'include $$(top_srcdir)user.mk' >> $@
@echo 'include ../Makefile.local' >> $@
@echo 'include $$(top_srcdir)makeshift/Makefile.common' >> $@
$(BUILTIN_CONFIGS): %: %/Makefile %/config.mk
$(MAKE) -C $* all
.PHONY: $(BUILTIN_CONFIGS)