-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
135 lines (116 loc) · 3.18 KB
/
GNUmakefile
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#
# OpenMP Source Code Repository
#
# General Makefile (To be processed by GNUmake)
#
# (c) 2004, Arturo Gonzalez Escribano
#
# Version: 0.3
#
# VERSION
OSCR_VERSION=2.0
# GENERAL CONVENTIONS
SHELL=/bin/sh
.SUFFIXES:
# PHONY TARGETS
.PHONY: help config all par seq clean distclean dist
#
# INFO
#
help:
@echo
@echo " Welcome to OpenMP Repository v$(OSCR_VERSION) !!!"
@echo
@echo "Usage:"
@echo
@echo " gmake config - Information about how to configure your compiler details"
@echo " gmake bashconfig - Interactive compilers configuration (bash shell)"
@echo " gmake ashconfig - Interactive compilers configuration (ash shell)"
@echo
@echo " gmake all - Will build all the versions of each application"
@echo " gmake seq - Will build only the sequential versions of applications"
@echo " gmake par - Will build only the parallel versions of applications"
@echo
@echo " gmake clean - Will remove the applications"
@echo " gmake distclean - Will remove applications and compiler configuration"
@echo " gmake help - Show this help"
@echo
#
# CONFIGURATION SCRIPT
#
config:
@echo
@echo OpenMP Repository compilers configuration...
@echo
@echo "To configure the makefiles to use your compilers and options,"
@echo "please, edit the file:"
@echo " ./config/templates/user.cf.mk"
@echo
@echo "There are more templates for specific plattforms in"
@echo " ./config/templates"
@echo "You may copy one of them as 'user.cf.mk' and adapt it"
@echo
@echo "Alternatively, if you have a bash(1) or ash(1) shell, you may use an"
@echo "interactive configuration script. Try: "
@echo " > gmake bashconfig"
@echo " > gmake ashconfig"
@echo
bashconfig:
@bash ./config/config.sh
ashconfig:
@ash ./config/config.sh
#
# DEBUG ( Default no, override with command line: $ gmake DEBUG=yes )
#
DEBUG=no
#
# DEFINE ALL OBJECTIVES (APPLICATION SUBDIRS)
#
ALL=common $(filter-out applications/CVS, $(wildcard applications/*))
#
# BUILD ONLY PARALLEL BINARIES
#
par:
@ $(foreach dir, $(ALL), gmake -C $(dir) DEBUG=$(DEBUG) par; )
@echo
@echo "Compilation command line for each application has been stored in ./log directory"
@echo
#
# BUILD ONLY SEQUENTIAL BINARIES
#
seq:
@ $(foreach dir, $(ALL), gmake -C $(dir) DEBUG=$(DEBUG) seq; )
@echo
@echo "Compilation command line for each application has been stored in ./log directory"
@echo
#
# BUILD ALL RULE
#
all:
@ $(foreach dir, $(ALL), gmake -C $(dir) DEBUG=$(DEBUG) all; )
@echo
@echo "Compilation command line for each application has been stored in ./log directory"
@echo
#
# CLEAN RULES
#
clean:
@ $(foreach dir, $(ALL), gmake -C $(dir) clean; )
distclean:
@ $(foreach dir, $(ALL), gmake -C $(dir) clean; )
cp ./config/templates/none.cf.mk ./config/templates/user.cf.mk
#
# CREATE DISTRIBUTION FILE RULE
#
DIST_NAME=OmpSCR_v$(OSCR_VERSION)
dist:
# @ gmake clean
# rm -f ./OmpSCR_v$(OSCR_VERSION).tar.gz
# tar cpf ./OmpSCR_v$(OSCR_VERSION).tar *
# gzip OmpSCR_v$(OSCR_VERSION).tar
@ gmake clean
rm -f ./OmpSCR_v$(OSCR_VERSION).tar.gz
ln -s `pwd` ./$(DIST_NAME)
tar cphf ./$(DIST_NAME).tar --exclude=./$(DIST_NAME)/$(DIST_NAME) ./$(DIST_NAME)
gzip OmpSCR_v$(OSCR_VERSION).tar
rm -f ./$(DIST_NAME)