-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
98 lines (78 loc) · 2.48 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
# Project: SPRINT
# File: Makefile - top-level makefile
# !!! Look into Options.make for configurable settings !!!
# -----------------------------------------------------------------------------
default: build
TOPDIR = .
SUBDIRS = src
BASEDIR = $(shell basename $(PWD))
include Config.make
# -----------------------------------------------------------------------------
# targets
world:
./scripts/build all
all: build test
build: config src/Modules.hh
$(MAKE) -C src build
test: build
$(MAKE) -s -C test test
tar: subdirs_recursive_distclean
cd .. ; \
tar cvf sprint.tar $(BASEDIR) ; \
gzip -f sprint.tar
config: report-make-environment
install:
install -d $(INSTALL_TARGET)
$(MAKE) -C src $@
statistics:
@$(TOPDIR)/scripts/statistics.sh
clean: clean_
clean_: subdirs_clean
rm src/Modules.hh
src/Modules.hh : $(TOPDIR)/Modules.make
@if [ -f $(TOPDIR)/scripts/dependencies.py ]; then \
$(TOPDIR)/scripts/dependencies.py --basedir $(TOPDIR) --check 2> /dev/null; \
fi
$(ECHO) '#ifndef _MODULES_HH' > $@
$(ECHO) '#define _MODULES_HH' >> $@
@printf "$(foreach module, $(MODULES),'#define' $(module) '\n')" | tr -d "'" | sed -e 's/^ *//' >> $@
$(ECHO) '#endif' >> $@
.PHONY: world all build test tar config install statistics
report-make-environment:
$(ECHO)
$(ECHO) "********************************************************************************"
$(ECHO) "Project:\t\tSPRINT"
$(ECHO) "********************************************************************************"
$(ECHO)
$(ECHO) "Build host:\t\t" `hostname`
$(ECHO) "Build date:\t\t" `date`
$(ECHO) "Build directory:\t" `pwd`
$(ECHO)
$(ECHO) "Processor:\t\t$(PROC)"
$(ECHO) "Operating system:\t$(OS)"
$(ECHO) "Version:\t\t$(VERSION) - $(COMPILE)"
$(ECHO) "Profiling:\t\t$(PROFILE)"
$(ECHO)
$(ECHO) "Compiler:\t\t$(CC) / $(CXX)"
$(ECHO) "Preprocessor flags:\t$(CPPFLAGS)"
$(ECHO) "C compiler flags:\t$(CFLAGS)"
$(ECHO) "C++ compiler flags:\t$(CXXFLAGS)"
$(ECHO)
$(ECHO) "Linker:\t\t\t$(LD)"
$(ECHO) "Linker flags:\t\t$(LDFLAGS)"
$(ECHO)
$(ECHO) "Binary suffix:\t\t$(OBJEXT)"
$(ECHO) "Build dir:\t\t$(OBJBUILDDIR)"
$(ECHO)
$(ECHO) "Installation directories:"
$(ECHO) -n " Base:\t\t\t"
$(ECHO) $(INSTALL_BASE)
$(ECHO) -n " Binaries:\t\t"
$(ECHO) $(INSTALL_BINDIR)
$(ECHO) -n " Includes:\t\t"
$(ECHO) $(INSTALL_INCDIR)
$(ECHO) -n " Libraries:\t\t"
$(ECHO) $(INSTALL_LIBDIR)
$(ECHO) "********************************************************************************"
$(ECHO)
include Rules.make