forked from PembrokeNS/sakusen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (60 loc) · 1.86 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
top_srcdir =
top_builddir =
this_srcdir =
all:
# Don't include the config file if we're trying to make it
ifneq ($(MAKECMDGOALS),config)
include config.mk
endif
include Makefile.local
include makefiles/Makefile.common
all-nonrecursive: config.mk
AUTOCONFIG = tools/autogenerate-config.sh
config.mk:
@echo
@echo "*** If you haven't looked at INSTALL yet, now might be a good time to"
@echo "*** hit Ctrl+C and do so."
@echo "*** Otherwise, best guess build will proceed in 2 seconds..."
@echo "*** (This message will only appear if config.mk is absent)"
@echo
sleep 2
$(AUTOCONFIG)
config:
$(AUTOCONFIG)
#####################################################
#
# 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 $*
rm -f $@
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
#####################################################
#
# docs
#
#####################################################
doc:
doxygen Doxyfile
.PHONY: config doc $(BUILTIN_CONFIGS)