-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
46 lines (37 loc) · 1.21 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
top_srcdir =
top_builddir =
this_srcdir =
all:
include config.mk
include Makefile.local
include makefiles/Makefile.common
config.mk:
touch $@
#####################################################
#
# Alternate build dir generation
#
#####################################################
BUILTIN_CONFIG_MK_SOURCES := $(wildcard makefiles/config.mk.*)
BUILTIN_CONFIGS := \
$(patsubst makefiles/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: makefiles/config.mk.%
@mkdir -p $*
ln -s ../$< $*/config.mk
$(BUILTIN_CONFIG_MAKEFILES): %/Makefile: $(top_srcdir)makefiles/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_builddir)config.mk' >> $@
@echo 'include ../Makefile.local' >> $@
@echo 'include $$(top_srcdir)makefiles/Makefile.common' >> $@
$(BUILTIN_CONFIGS): %: %/Makefile %/config.mk
$(MAKE) -C $* all