STYLE: sampledPlane : added comment about calling update() after construction
[OpenFOAM-1.6.x.git] / wmake / Makefile
blob28b7015b71dbc899c4bb4eea9845ac53edb34683
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 the
13 # Free Software Foundation; either version 2 of the License, or (at your
14 # 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, write to the Free Software Foundation,
23 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 # Script
26 # Makefile
28 # Description
29 # Generic Makefile used by wmake
31 #------------------------------------------------------------------------------
33 #------------------------------------------------------------------------------
34 # The Makefile use a POSIX shell
35 #------------------------------------------------------------------------------
37 SHELL = /bin/sh
40 #------------------------------------------------------------------------------
41 # Initialise suffices list
42 #------------------------------------------------------------------------------
44 .SUFFIXES:
45 .SUFFIXES: .o
48 #------------------------------------------------------------------------------
49 # Set the directory containing the wmake scripts
50 #------------------------------------------------------------------------------
52 WM_SCRIPTS = $(WM_DIR)/scripts
55 #------------------------------------------------------------------------------
56 # declare default paths
57 #------------------------------------------------------------------------------
59 LIB_SRC = $(WM_PROJECT_DIR)/src
60 LIB_DIR = $(WM_PROJECT_DIR)/lib
61 LIB_WM_OPTIONS_DIR = $(LIB_DIR)/$(WM_OPTIONS)
62 OBJECTS_DIR = $(MAKE_DIR)/$(WM_OPTIONS)
63 CLASSES_DIR = $(MAKE_DIR)/classes
65 SYS_INC =
66 SYS_LIBS =
68 PROJECT_INC = -I$(LIB_SRC)/$(WM_PROJECT)/lnInclude -I$(LIB_SRC)/OSspecific/$(WM_OSTYPE)/lnInclude
69 PROJECT_LIBS = -l$(WM_PROJECT)
71 ## unused:
72 ## PROJECT_VERSION = $(shell printf -- "-DPROJECT_VERSION=%d%03d%03d" $$(echo $(WM_PROJECT_VERSION) | sed -e 's/\./ /g'))
75 EXE_INC =
76 EXE_LIBS =
78 LIB_LIBS =
81 #------------------------------------------------------------------------------
82 # declare all .o files depend on $(OBJECTS_DIR)/options
83 #------------------------------------------------------------------------------
85 EXE_DEP = $(OBJECTS_DIR)/options
88 #------------------------------------------------------------------------------
89 # declare default name of libraries and executables
90 #------------------------------------------------------------------------------
92 # Library
93 LIB = libNULL
95 # Shared library extension
96 SO = so
98 # Project executable
99 EXE = $(WM_PROJECT).out
101 # Standalone executable
102 SEXE = a.out
105 #------------------------------------------------------------------------------
106 # set compilation and dependency building rules
107 #------------------------------------------------------------------------------
109 GENERAL_RULES = $(WM_DIR)/rules/General
110 RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER)
111 BIN = $(WM_DIR)/bin/$(WM_ARCH)$(WM_COMPILER)
113 include $(GENERAL_RULES)/general
114 include $(RULES)/general
115 include $(RULES)/$(WM_LINK_LANGUAGE)
117 MAKE_DEP = @$(MKDEP) $< | $(WM_SCRIPTS)/addCompile $<
120 #------------------------------------------------------------------------------
121 # Include PROJECT directory tree file and
122 # source, object and dependency list files.
123 # These are constructed by wmakeDerivedFiles
124 #------------------------------------------------------------------------------
126 include $(OBJECTS_DIR)/options
127 include $(OBJECTS_DIR)/filesMacros
128 include $(OBJECTS_DIR)/sourceFiles
129 include $(OBJECTS_DIR)/objectFiles
130 include $(OBJECTS_DIR)/localObjectFiles
131 include $(OBJECTS_DIR)/dependencyFiles
133 #------------------------------------------------------------------------------
134 # set header file include paths
135 #------------------------------------------------------------------------------
137 LIB_HEADER_DIRS = \
138 $(EXE_INC) \
139 -IlnInclude \
140 -I. \
141 $(PROJECT_INC) \
142 $(GINC) \
143 $(SYS_INC)
146 #------------------------------------------------------------------------------
147 # define link statements for executables
148 #------------------------------------------------------------------------------
150 $(EXE): $(OBJECTS)
151 @$(WM_SCRIPTS)/mkObjectDir $(EXE)
152 $(LINKEXE) $(OBJECTS) -L$(LIB_WM_OPTIONS_DIR) \
153 $(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(EXE)
155 exe: $(SEXE)
156 @echo \'$(SEXE)\' is up to date.
158 $(SEXE): $(OBJECTS)
159 @$(WM_SCRIPTS)/mkObjectDir $(SEXE)
160 $(LINKEXE) $(OBJECTS) $(EXE_LIBS) \
161 $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(SEXE)
164 #------------------------------------------------------------------------------
165 # define link statements for libraries
166 #------------------------------------------------------------------------------
168 libso: $(LIB).$(SO)
169 @echo \'$(LIB).$(SO)\' is up to date.
171 $(LIB).$(SO): $(OBJECTS)
172 @$(WM_SCRIPTS)/mkObjectDir $(LIB)
173 @rm -f so_locations
174 @cd $(OBJECTS_DIR) ; \
175 $(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_WM_OPTIONS_DIR) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO)
177 lib: $(LIB).a
178 @echo \'$(LIB).a\' is up to date.
180 $(LIB).a: $(OBJECTS)
181 @$(WM_SCRIPTS)/mkObjectDir $(LIB)
182 @rm -f $(LIB).a
183 $(AR) $(ARFLAGS) $(LIB).a $(OBJECTS)
184 $(RANLIB) $(LIB).a
186 libo: $(LIB).o
187 @echo \'$(LIB).o\' is up to date.
189 $(LIB).o: $(OBJECTS)
190 @$(WM_SCRIPTS)/mkObjectDir $(LIB)
191 @rm -f $(LIB).o
192 $(LD) -r -o $(LIB).o $(OBJECTS)
194 jar: $(LIB).jar
195 @echo \'$(LIB).jar\' is up to date.
197 $(LIB).jar: $(OBJECTS)
198 @$(WM_SCRIPTS)/mkObjectDir $(LIB)
199 jar cfm $(LIB).jar $(LIB_LIBS) -C $(CLASSES_DIR) .
201 #------------------------------------------------------------------------------
202 # Set rule to create the include directory for libraries
203 #------------------------------------------------------------------------------
205 lnInclude/uptodate: $(MAKE_DIR)/files $(MAKE_DIR)/options
206 @rm -rf lnInclude ; wmakeLnInclude . ; touch lnInclude/uptodate
209 #------------------------------------------------------------------------------
210 # Set depedency rule and include dependency lists
211 #------------------------------------------------------------------------------
213 $(OBJECTS_DIR)/dependencies: $(DEPENDENCIES)
214 @echo dependencies up to date > $(OBJECTS_DIR)/dependencies
216 include $(INCLUDE_DEPS)
219 #------------------------------------------------------------------------------