Removed dependency on objectRegistry in constructor
[foam-extend-3.0.git] / wmake / Makefile
blob1eca268550fb802790cd29ba5cffaafdc55e5b31
1 #------------------------------------------------------------------------------
2 # ========= |
3 # \\ / F ield | foam-extend: Open Source CFD
4 # \\ / O peration |
5 # \\ / A nd | For copyright notice see file Copyright
6 # \\/ M anipulation |
7 #------------------------------------------------------------------------------
8 # License
9 # This file is part of foam-extend.
11 # foam-extend 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 3 of the License, or (at your
14 # option) any later version.
16 # foam-extend is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 # General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with foam-extend. 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)
69 PROJECT_VERSION = $(shell printf -- "-DPROJECT_VERSION=%d%03d%03d" $$(echo $(WM_PROJECT_VERSION) | sed -e 's/\./ /g'))
71 EXE_INC =
72 EXE_LIBS =
74 LIB_LIBS =
77 #------------------------------------------------------------------------------
78 # declare all .o files depend on $(OBJECTS_DIR)/options
79 #------------------------------------------------------------------------------
81 EXE_DEP = $(OBJECTS_DIR)/options
84 #------------------------------------------------------------------------------
85 # declare default name of libraries and executables
86 #------------------------------------------------------------------------------
88 # Library
89 LIB = libNULL
91 # Shared library extension
92 ifeq ($(WM_ARCH_BASE),darwin)
93 # Using Mac OSX
94 SO = dylib
95 else
96 SO = so
97 endif
99 # Project executable
100 EXE = $(WM_PROJECT).out
102 # Standalone executable
103 SEXE = a.out
106 #------------------------------------------------------------------------------
107 # set compilation and dependency building rules
108 #------------------------------------------------------------------------------
110 GENERAL_RULES = $(WM_DIR)/rules/General
111 RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER)
112 BIN = $(WM_DIR)/bin/$(WM_ARCH)$(WM_COMPILER)
114 include $(GENERAL_RULES)/general
115 include $(RULES)/general
116 include $(RULES)/$(WM_LINK_LANGUAGE)
118 MAKE_DEP = @$(MKDEP) $< | $(WM_SCRIPTS)/addCompile $<
121 #------------------------------------------------------------------------------
122 # Include PROJECT directory tree file and
123 # source, object and dependency list files.
124 # These are constructed by wmakeDerivedFiles
125 #------------------------------------------------------------------------------
127 include $(OBJECTS_DIR)/options
128 include $(OBJECTS_DIR)/filesMacros
129 include $(OBJECTS_DIR)/sourceFiles
130 include $(OBJECTS_DIR)/objectFiles
131 include $(OBJECTS_DIR)/localObjectFiles
132 include $(OBJECTS_DIR)/dependencyFiles
134 #------------------------------------------------------------------------------
135 # set header file include paths
136 #------------------------------------------------------------------------------
138 LIB_HEADER_DIRS = \
139 $(EXE_INC) \
140 -IlnInclude \
141 -I. \
142 $(PROJECT_INC) \
143 $(GINC) \
144 $(SYS_INC)
147 #------------------------------------------------------------------------------
148 # define link statements for executables
149 #------------------------------------------------------------------------------
151 $(EXE): $(OBJECTS)
152 @$(WM_SCRIPTS)/mkObjectDir $(EXE)
153 $(LINKEXE) $(OBJECTS) -L$(LIB_WM_OPTIONS_DIR) \
154 $(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(EXE)
156 exe: $(SEXE)
157 @echo \'$(SEXE)\' is up to date.
159 $(SEXE): $(OBJECTS)
160 @$(WM_SCRIPTS)/mkObjectDir $(SEXE)
161 $(LINKEXE) $(OBJECTS) $(EXE_LIBS) \
162 $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(SEXE)
165 #------------------------------------------------------------------------------
166 # define link statements for libraries
167 #------------------------------------------------------------------------------
169 libso: $(LIB).$(SO)
170 @echo \'$(LIB).$(SO)\' is up to date.
172 $(LIB).$(SO): $(OBJECTS)
173 @$(WM_SCRIPTS)/mkObjectDir $(LIB)
174 @rm -f so_locations
175 ifeq ($(WM_ARCH_BASE),darwin)
176 @cd $(OBJECTS_DIR) ; \
177 $(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_WM_OPTIONS_DIR) $(LIB_LIBS) $(GLIB_LIBS) -install_name $(notdir $(LIB)).$(SO) -o $(LIB).$(SO)
178 else
179 @cd $(OBJECTS_DIR) ; \
180 $(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_WM_OPTIONS_DIR) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO)
181 endif
183 lib: $(LIB).a
184 @echo \'$(LIB).a\' is up to date.
186 $(LIB).a: $(OBJECTS)
187 @$(WM_SCRIPTS)/mkObjectDir $(LIB)
188 @rm -f $(LIB).a
189 $(AR) $(ARFLAGS) $(LIB).a $(OBJECTS)
190 $(RANLIB) $(LIB).a
192 libo: $(LIB).o
193 @echo \'$(LIB).o\' is up to date.
195 $(LIB).o: $(OBJECTS)
196 @$(WM_SCRIPTS)/mkObjectDir $(LIB)
197 @rm -f $(LIB).o
198 $(LD) -r -o $(LIB).o $(OBJECTS)
200 jar: $(LIB).jar
201 @echo \'$(LIB).jar\' is up to date.
203 $(LIB).jar: $(OBJECTS)
204 @$(WM_SCRIPTS)/mkObjectDir $(LIB)
205 jar cfm $(LIB).jar $(LIB_LIBS) -C $(CLASSES_DIR) .
207 #------------------------------------------------------------------------------
208 # Set rule to create the include directory for libraries
209 #------------------------------------------------------------------------------
211 lnInclude/uptodate: $(MAKE_DIR)/files $(MAKE_DIR)/options
212 @rm -rf lnInclude ; wmakeLnInclude . ; touch lnInclude/uptodate
215 #------------------------------------------------------------------------------
216 # Set depedency rule and include dependency lists
217 #------------------------------------------------------------------------------
219 $(OBJECTS_DIR)/dependencies: $(DEPENDENCIES)
220 @echo dependencies up to date > $(OBJECTS_DIR)/dependencies
222 include $(INCLUDE_DEPS)
225 #------------------------------------------------------------------------------