ENH: RASModel.C: clipping input to log
[OpenFOAM-1.7.x.git] / wmake / Makefile
blob2f2be981fb192bf01e87613a6e9e860b586d73bc
1 #------------------------------------------------------------------------------
2 # ========= |
3 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 # \\ / O peration |
5 # \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
6 # \\/ M anipulation |
7 #------------------------------------------------------------------------------
8 # License
9 # This file is part of OpenFOAM.
11 # OpenFOAM is free software: you can redistribute it and/or modify it
12 # under the terms of the GNU General Public License as published by
13 # the Free Software Foundation, either version 3 of the License, or
14 # (at your option) any later version.
16 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 # for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 # Script
25 # Makefile
27 # Description
28 # Generic Makefile used by wmake
30 #------------------------------------------------------------------------------
32 #------------------------------------------------------------------------------
33 # The Makefile use a POSIX shell
34 #------------------------------------------------------------------------------
36 SHELL = /bin/sh
39 #------------------------------------------------------------------------------
40 # Initialise suffices list
41 #------------------------------------------------------------------------------
43 .SUFFIXES:
44 .SUFFIXES: .o
47 #------------------------------------------------------------------------------
48 # Set the directory containing the wmake scripts
49 #------------------------------------------------------------------------------
51 WM_SCRIPTS = $(WM_DIR)/scripts
54 #------------------------------------------------------------------------------
55 # declare default paths
56 #------------------------------------------------------------------------------
58 LIB_SRC = $(WM_PROJECT_DIR)/src
59 LIB_DIR = $(WM_PROJECT_DIR)/lib
60 LIB_WM_OPTIONS_DIR = $(LIB_DIR)/$(WM_OPTIONS)
61 OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS)
62 CLASSES_DIR = $(MAKE_DIR)/classes
64 SYS_INC =
65 SYS_LIBS =
67 PROJECT_INC = -I$(LIB_SRC)/$(WM_PROJECT)/lnInclude -I$(LIB_SRC)/OSspecific/$(WM_OSTYPE)/lnInclude
68 PROJECT_LIBS = -l$(WM_PROJECT)
70 ## unused:
71 ## PROJECT_VERSION = $(shell printf -- "-DPROJECT_VERSION=%d%03d%03d" $$(echo $(WM_PROJECT_VERSION) | sed -e 's/\./ /g'))
74 EXE_INC =
75 EXE_LIBS =
77 LIB_LIBS =
80 #------------------------------------------------------------------------------
81 # declare all .o files depend on $(OBJECTS_DIR)/options
82 #------------------------------------------------------------------------------
84 EXE_DEP = $(OBJECTS_DIR)/options
87 #------------------------------------------------------------------------------
88 # declare default name of libraries and executables
89 #------------------------------------------------------------------------------
91 # Library
92 LIB = libNULL
94 # Shared library extension
95 SO = so
97 # Project executable
98 EXE = $(WM_PROJECT).out
100 # Standalone executable
101 SEXE = a.out
104 #------------------------------------------------------------------------------
105 # set compilation and dependency building rules
106 #------------------------------------------------------------------------------
108 GENERAL_RULES = $(WM_DIR)/rules/General
109 RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER)
110 BIN = $(WM_DIR)/bin/$(WM_ARCH)$(WM_COMPILER)
112 include $(GENERAL_RULES)/general
113 include $(RULES)/general
114 include $(RULES)/$(WM_LINK_LANGUAGE)
116 MAKE_DEP = @$(MKDEP) $< | $(WM_SCRIPTS)/addCompile $<
119 #------------------------------------------------------------------------------
120 # Include PROJECT directory tree file and
121 # source, object and dependency list files.
122 # These are constructed by wmakeDerivedFiles
123 #------------------------------------------------------------------------------
125 include $(OBJECTS_DIR)/options
126 include $(OBJECTS_DIR)/filesMacros
127 include $(OBJECTS_DIR)/sourceFiles
128 include $(OBJECTS_DIR)/objectFiles
129 include $(OBJECTS_DIR)/localObjectFiles
130 include $(OBJECTS_DIR)/dependencyFiles
132 #------------------------------------------------------------------------------
133 # set header file include paths
134 #------------------------------------------------------------------------------
136 LIB_HEADER_DIRS = \
137 $(EXE_INC) \
138 -IlnInclude \
139 -I. \
140 $(PROJECT_INC) \
141 $(GINC) \
142 $(SYS_INC)
145 #------------------------------------------------------------------------------
146 # define link statements for executables
147 #------------------------------------------------------------------------------
149 $(EXE): $(OBJECTS)
150 @$(WM_SCRIPTS)/mkObjectDir $(EXE)
151 $(LINKEXE) $(OBJECTS) -L$(LIB_WM_OPTIONS_DIR) \
152 $(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(EXE)
154 exe: $(SEXE)
155 @echo \'$(SEXE)\' is up to date.
157 $(SEXE): $(OBJECTS)
158 @$(WM_SCRIPTS)/mkObjectDir $(SEXE)
159 $(LINKEXE) $(OBJECTS) $(EXE_LIBS) \
160 $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(SEXE)
163 #------------------------------------------------------------------------------
164 # define link statements for libraries
165 #------------------------------------------------------------------------------
167 libso: $(LIB).$(SO)
168 @echo \'$(LIB).$(SO)\' is up to date.
170 $(LIB).$(SO): $(OBJECTS)
171 @$(WM_SCRIPTS)/mkObjectDir $(LIB)
172 @rm -f so_locations
173 @cd $(OBJECTS_DIR) ; \
174 $(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_WM_OPTIONS_DIR) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO)
176 lib: $(LIB).a
177 @echo \'$(LIB).a\' is up to date.
179 $(LIB).a: $(OBJECTS)
180 @$(WM_SCRIPTS)/mkObjectDir $(LIB)
181 @rm -f $(LIB).a
182 $(AR) $(ARFLAGS) $(LIB).a $(OBJECTS)
183 $(RANLIB) $(LIB).a
185 libo: $(LIB).o
186 @echo \'$(LIB).o\' is up to date.
188 $(LIB).o: $(OBJECTS)
189 @$(WM_SCRIPTS)/mkObjectDir $(LIB)
190 @rm -f $(LIB).o
191 $(LD) -r -o $(LIB).o $(OBJECTS)
193 jar: $(LIB).jar
194 @echo \'$(LIB).jar\' is up to date.
196 $(LIB).jar: $(OBJECTS)
197 @$(WM_SCRIPTS)/mkObjectDir $(LIB)
198 jar cfm $(LIB).jar $(LIB_LIBS) -C $(CLASSES_DIR) .
200 #------------------------------------------------------------------------------
201 # Set rule to create the include directory for libraries
202 #------------------------------------------------------------------------------
204 lnInclude/uptodate: $(MAKE_DIR)/files $(MAKE_DIR)/options
205 @rm -rf lnInclude ; wmakeLnInclude . ; touch lnInclude/uptodate
208 #------------------------------------------------------------------------------
209 # Set depedency rule and include dependency lists
210 #------------------------------------------------------------------------------
212 $(OBJECTS_DIR)/dependencies: $(DEPENDENCIES)
213 @echo dependencies up to date > $(OBJECTS_DIR)/dependencies
215 include $(INCLUDE_DEPS)
218 #------------------------------------------------------------------------------