-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathGNUmakefile
More file actions
63 lines (52 loc) · 1.59 KB
/
GNUmakefile
File metadata and controls
63 lines (52 loc) · 1.59 KB
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
# This is a wrapper makefile which exists before configuration.
# It hands over to the Makefile produced by configure.
CONFIG_MK := Makefile
SPECIAL := bootstrap configure debian-package help
# If the user didn't specify any goals, default to "all"
DEFAULT_GOAL := all
.DEFAULT_GOAL := $(DEFAULT_GOAL)
.PHONY: $(SPECIAL) $(DEFAULT_GOAL)
bootstrap:
./autogen.sh && ./configure
configure:
./configure
debian-package:
@if [ ! -f "$(CONFIG_MK)" ]; then \
if [ ! -f "Makefile.in" ]; then \
./autogen.sh; \
fi; \
./configure; \
fi; \
$(MAKE) -f "$(CONFIG_MK)" debian-package
help:
@echo "make [TARGETS...] (after ./configure)"
@echo "make bootstrap" run ./autogen.sh and ./configure
@echo "make configure" run ./configure
@echo "make debian-package build and sign Debian package
# Default "make" (no args)
$(DEFAULT_GOAL):
@if [ -f "$(CONFIG_MK)" ]; then \
$(MAKE) -f "$(CONFIG_MK)" $(DEFAULT_GOAL); \
else \
echo "Not configured. Run: ./autogen.sh && ./configure"; \
exit 1; \
fi
# If user specified goals, forward them unless they are SPECIAL.
ifneq ($(strip $(MAKECMDGOALS)),)
# Error out if they mixed wrapper-special goals with forwarded goals (optional)
MIXED := $(filter $(SPECIAL),$(MAKECMDGOALS))
OTHER := $(filter-out $(SPECIAL),$(MAKECMDGOALS))
ifneq ($(strip $(MIXED)),)
ifneq ($(strip $(OTHER)),)
$(error Don't mix $(MIXED) with $(OTHER). Run bootstrap/configure separately.)
endif
endif
.PHONY: $(OTHER)
$(OTHER):
@if [ -f "$(CONFIG_MK)" ]; then \
$(MAKE) -f "$(CONFIG_MK)" $(OTHER); \
else \
echo "Not configured. Run: ./autogen.sh && ./configure"; \
exit 1; \
fi
endif