33 |
|
# $< - Current dependency |
34 |
|
# |
35 |
|
#--------------------------------------------------------------------------- |
36 |
< |
|
37 |
< |
#--------------------------------------------------------------------------- |
38 |
< |
# |
39 |
< |
# Packages |
40 |
< |
# |
41 |
< |
#--------------------------------------------------------------------------- |
42 |
< |
|
36 |
> |
IS_UNIX=1 |
37 |
|
#packages to be made |
38 |
|
Packages = \ |
39 |
< |
utils \ |
40 |
< |
math \ |
41 |
< |
types \ |
42 |
< |
primitives \ |
43 |
< |
visitors \ |
44 |
< |
UseTheForce/DarkSide \ |
45 |
< |
UseTheForce \ |
46 |
< |
brains \ |
47 |
< |
io \ |
48 |
< |
integrators \ |
49 |
< |
minimizers \ |
50 |
< |
constraints \ |
51 |
< |
profiling \ |
52 |
< |
restraints \ |
53 |
< |
applications |
39 |
> |
utils \ |
40 |
> |
math \ |
41 |
> |
types \ |
42 |
> |
primitives \ |
43 |
> |
visitors \ |
44 |
> |
UseTheForce/DarkSide \ |
45 |
> |
UseTheForce \ |
46 |
> |
brains \ |
47 |
> |
io \ |
48 |
> |
integrators \ |
49 |
> |
minimizers \ |
50 |
> |
constraints \ |
51 |
> |
profiling \ |
52 |
> |
restraints \ |
53 |
> |
applications/oopse \ |
54 |
> |
applications/dump2Xyz \ |
55 |
> |
applications/simpleBuilder \ |
56 |
|
|
57 |
|
#packages contain libraries |
58 |
|
PackageLibs = \ |
59 |
< |
utils \ |
60 |
< |
math \ |
61 |
< |
types \ |
62 |
< |
primitives \ |
63 |
< |
visitors \ |
64 |
< |
UseTheForce/DarkSide \ |
65 |
< |
UseTheForce \ |
66 |
< |
brains \ |
67 |
< |
io \ |
68 |
< |
integrators \ |
69 |
< |
minimizers \ |
70 |
< |
constraints \ |
71 |
< |
profiling \ |
72 |
< |
restraints |
59 |
> |
utils \ |
60 |
> |
math \ |
61 |
> |
types \ |
62 |
> |
primitives \ |
63 |
> |
visitors \ |
64 |
> |
UseTheForce/DarkSide \ |
65 |
> |
UseTheForce \ |
66 |
> |
brains \ |
67 |
> |
io \ |
68 |
> |
integrators \ |
69 |
> |
minimizers \ |
70 |
> |
constraints \ |
71 |
> |
profiling \ |
72 |
> |
restraints \ |
73 |
|
|
74 |
+ |
IncludeDirs = \ |
75 |
+ |
@SPRNG_INC_DIR@ \ |
76 |
+ |
@MPI_INC_DIR@ |
77 |
+ |
|
78 |
+ |
LibraryDirs = \ |
79 |
+ |
@SPRNG_LIB_DIR@ \ |
80 |
+ |
@MPI_LIB_DIR@ |
81 |
+ |
|
82 |
+ |
Libraries = \ |
83 |
+ |
@SPRNG_LIB@ \ |
84 |
+ |
@MPI_LIB@ |
85 |
+ |
|
86 |
+ |
LinkOptions = \ |
87 |
+ |
@F90LIBS@ |
88 |
+ |
|
89 |
+ |
OopseHome = @OOPSE_HOME@ |
90 |
+ |
ForceParamDir = @OOPSE_HOME@/share/forceFields/ |
91 |
+ |
SampleSimDir = @OOPSE_HOME@/share/samples/ |
92 |
+ |
FrcDeclare = -DFRC_PATH="$(ForceParamDir)" |
93 |
+ |
ParallelDeclare = -DIS_MPI |
94 |
+ |
|
95 |
+ |
|
96 |
|
#--------------------------------------------------------------------------- |
97 |
|
# |
98 |
|
# Directories |
99 |
|
# |
100 |
|
#--------------------------------------------------------------------------- |
101 |
|
|
84 |
– |
srcdir = @srcdir@ |
102 |
|
SourceDir = $(DEV_ROOT)/src |
103 |
|
TargetDir = $(DEV_ROOT)/obj |
104 |
|
ParallelTargetDir = $(DEV_ROOT)/MPIobj |
207 |
|
Executable = $(BinDir)/$(Main) |
208 |
|
ParallelExecutable = $(BinDir)/$(Main)_MPI |
209 |
|
else |
210 |
< |
SharedLibrary = $(LibDir)/lib$(subst /,,$(Package)).so |
211 |
< |
StaticLibrary = $(LibDir)/lib$(subst /,,$(Package)).a |
212 |
< |
ParallelSharedLibrary = $(LibDir)/lib$(subst /,,$(Package))_MPI.so |
213 |
< |
ParallelStaticLibrary = $(LibDir)/lib$(subst /,,$(Package))_MPI.a |
210 |
> |
SharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).so |
211 |
> |
StaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package))).a |
212 |
> |
ParallelSharedLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.so |
213 |
> |
ParallelStaticLibrary = $(LibDir)/lib$(subst /,,$(patsubst %,oopse_%,$(Package)))_MPI.a |
214 |
|
endif |
215 |
|
endif |
216 |
|
# |
220 |
|
JavaPackageNames = $(subst /,.,$(JavaPackages)) |
221 |
|
IncludePath = -I$(SourceDir) $(IncludeDirs:%=-I%) |
222 |
|
LibDirs = -L$(LibDir) $(LibraryDirs:%=-L%) |
223 |
< |
LocalLibs = $(subst /,,$(PackageLibs)) |
224 |
< |
LibList = $(LocalLibs:%=-l%) $(Libraries:%=-l%) |
223 |
> |
LocalLibs = $(subst /,,$(patsubst %, oopse_%, $(PackageLibs))) |
224 |
> |
ParallelLocalLibs= $(subst /,,$(patsubst %, oopse_%_MPI, $(PackageLibs))) |
225 |
> |
LibList = $(LocalLibs:%=-l%) $(Libraries) |
226 |
> |
ParallelLibList = $(LocalLibs:%=-l%) $(Libraries) |
227 |
|
|
228 |
|
|
229 |
|
#--------------------------------------------------------------------------- |
261 |
|
Lex = @LEX@ |
262 |
|
|
263 |
|
|
264 |
< |
MakeOptions = -k -s |
264 |
> |
MakeOptions = -k |
265 |
|
MakeDependOptions = |
266 |
|
StaticArchiverOptions = rc |
267 |
|
DynamicArchiverOptions = -shared |
269 |
|
JniOptions = |
270 |
|
RmiOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
271 |
|
-sourcepath $(SourceDir) |
272 |
+ |
COptions = $(FrcDeclare) |
273 |
+ |
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
274 |
+ |
CppOptions = $(FrcDeclare) |
275 |
+ |
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
276 |
|
FortranOptions = |
277 |
< |
F90Options = -I$(SourceDir) -module $(TargetDir) |
277 |
> |
F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir) |
278 |
> |
F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir) @PREPDEFFLAG@$(ParallelDeclare) |
279 |
|
JavaCompilerOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
280 |
|
-sourcepath $(SourceDir) -deprecation |
281 |
|
JavaRunOptions = -classpath $(ClassPath) |
316 |
|
# .c -> .o |
317 |
|
$(PackageTargetDir)/%.o : %.c |
318 |
|
$(Print) $@ |
319 |
< |
$(Print) $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@ |
296 |
< |
@$(CCompiler) $(COptions) -c $(IncludePath) $< -o $@ |
319 |
> |
$(CCompiler) $(COptions) -c $(IncludePath) $< -o $@ |
320 |
|
|
321 |
|
%.o : %.c |
322 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
323 |
|
|
324 |
|
# .cpp -> .o |
325 |
|
$(PackageTargetDir)/%.o : %.cpp |
303 |
– |
$(Print) $@ |
304 |
– |
$(Print) $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@ |
326 |
|
$(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@ |
327 |
|
|
328 |
|
%.o : %.cpp |
330 |
|
|
331 |
|
# .f -> .o |
332 |
|
$(PackageTargetDir)/%.o : %.f |
333 |
< |
$(Print) $@ |
313 |
< |
$(Print) $(FortranCompiler) $(FortranOptions) -c $< -o $@ |
314 |
< |
@$(FortranCompiler) $(FortranOptions) -c $< -o $@ |
333 |
> |
$(FortranCompiler) $(FortranOptions) -c $< -o $@ |
334 |
|
|
335 |
|
%.o : %.f |
336 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
337 |
|
|
338 |
|
# .F90 -> .o |
339 |
|
$(PackageTargetDir)/%.o : %.F90 |
340 |
< |
$(Print) $@ |
322 |
< |
$(Print) $(F90Compiler) $(F90Options) -c $< -o $@ |
323 |
< |
@$(F90Compiler) $(F90Options) -c $< -o $@ |
340 |
> |
$(F90Compiler) $(F90Options) -c $< -o $@ |
341 |
|
|
342 |
|
%.o : %.F90 |
343 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
344 |
|
|
345 |
|
# .java -> .class |
346 |
|
$(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java |
347 |
< |
$(Print) $@ |
331 |
< |
$(Print) $(JavaCompiler) $(JavaCompilerOptions) $< |
332 |
< |
@$(JavaCompiler) $(JavaCompilerOptions) $< |
347 |
> |
$(JavaCompiler) $(JavaCompilerOptions) $< |
348 |
|
|
349 |
|
%.class : $(PackageSourceDir)/%.java |
350 |
|
@$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
351 |
|
|
352 |
|
# .class -> .h |
353 |
|
$(PackageSourceDir)/%.h : $(PackageTargetDir)/%.class |
339 |
– |
$(Print) $@ |
340 |
– |
$(Print) $(JniCompiler) $(JniOptions) $(JavaPackageName).$* |
354 |
|
$(JniCompiler) $(JniOptions) $(JavaPackageName).$* |
355 |
|
|
356 |
|
%.h : %.class |
358 |
|
|
359 |
|
#.y -> .h |
360 |
|
%.h : %.y |
361 |
< |
$(Print) $@ |
349 |
< |
$(Print) @$(Yacc) -d $? |
350 |
< |
@$(Yacc) -d $? |
361 |
> |
$(Yacc) -d $? |
362 |
|
@$(Move) y.tab.h $*.h |
363 |
|
@$(Delete) y.tab.c |
364 |
|
|
365 |
|
#.y -> .c |
366 |
|
%.c : %.y |
367 |
< |
$(Print) $@ |
357 |
< |
$(Print) $(Yacc) -d $? |
358 |
< |
@$(Yacc) -d $? |
367 |
> |
$(Yacc) -d $? |
368 |
|
@$(Move) y.tab.c $*.c |
369 |
|
@$(Delete) y.tab.h |
370 |
|
|
376 |
|
|
377 |
|
# .o -> .a |
378 |
|
$(LibDir)/%.a : $(ObjectFiles) |
379 |
< |
$(Print) $@ |
371 |
< |
$(Print) $(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles) |
372 |
< |
@$(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles) |
379 |
> |
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles) |
380 |
|
|
381 |
|
%.a : $(ObjectFiles) |
382 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
383 |
|
|
384 |
|
$(LibDir)/%_MPI.a : $(ParallelObjectFiles) |
385 |
< |
$(Print) $@ |
379 |
< |
$(Print) $(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles) |
380 |
< |
@$(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles) |
385 |
> |
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles) |
386 |
|
|
387 |
|
%_MPI.a : $(ParallelObjectFiles) |
388 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
389 |
|
|
390 |
|
# .o -> .so |
391 |
|
$(LibDir)/%.so : $(ObjectFiles) |
387 |
– |
$(Print) $@ |
388 |
– |
$(Print) $(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@ |
392 |
|
$(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@ |
393 |
|
|
394 |
|
%.so : $(ObjectFiles) |
395 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
396 |
|
|
397 |
|
$(LibDir)/%_MPI.so : $(ParallelObjectFiles) |
395 |
– |
$(Print) $@ |
396 |
– |
$(Print) $(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@ |
398 |
|
$(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@ |
399 |
|
|
400 |
|
%_MPI.so : $(ParallelObjectFiles) |
403 |
|
# .class -> .jar |
404 |
|
$(LibDir)/%.jar : $(JavaClassFiles) $(OtherTargetFiles) |
405 |
|
$(Print) $@ |
405 |
– |
$(Print) $(JavaArchiver) -cf $@ $(JavaClassFilesRel) $(OtherTargetFiles) |
406 |
|
@cd $(TargetDir); $(JavaArchiver) -cf $@ \ |
407 |
|
$(JavaClassFilesRel) $(OtherTargetFiles) |
408 |
|
|
434 |
|
|
435 |
|
# Executable |
436 |
|
$(Executable) : $(ObjectFiles) |
437 |
– |
$(Print) $@ |
438 |
– |
$(Print) $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@ |
437 |
|
$(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@ |
438 |
|
|
439 |
|
$(ParallelExecutable) : $(ParallelObjectFiles) |
440 |
< |
$(Print) $@ |
443 |
< |
$(Print) $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ParallelObjectFiles) -o $@ |
444 |
< |
$(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ParallelObjectFiles) -o $@ |
440 |
> |
$(Linker) $(LinkOptions) $(LibDirs) $(ParallelLibList) $(ParallelObjectFiles) -o $@ |
441 |
|
|
442 |
|
# Anything else is just copied from source to target |
443 |
|
$(PackageTargetDir)/% : $(PackageSourceDir)/% |
462 |
|
$(StaticLibrary) \ |
463 |
|
$(JarFile) \ |
464 |
|
$(Executable) |
465 |
+ |
|
466 |
|
|
470 |
– |
|
467 |
|
# make clean |
468 |
|
clean : $(PackageListLoop) |
469 |
|
$(Print) Done clean. |
470 |
|
|
471 |
|
_cleanall : |
472 |
< |
$(Delete) $(PackageTargetDir)/* \ |
472 |
> |
$(Delete) $(ObjectFiles) $(ParallelObjectFiles) |
473 |
> |
|
474 |
> |
# make distclean |
475 |
> |
distclean : $(PackageListLoop) |
476 |
> |
$(Print) Done clean. |
477 |
> |
|
478 |
> |
_distcleanall : |
479 |
> |
$(Delete) $(ObjectFiles) \ |
480 |
> |
$(ParallelObjectFiles) \ |
481 |
|
$(JarFile) \ |
482 |
|
$(SharedLibrary) \ |
483 |
|
$(StaticLibrary) \ |
484 |
+ |
$(ParallelSharedLibrary) \ |
485 |
+ |
$(ParallelStaticLibrary) \ |
486 |
|
$(Executable) \ |
487 |
+ |
$(ParallelExecutable) \ |
488 |
|
$(DependencyFile) |
489 |
|
|
490 |
|
|
502 |
|
touch Make.ctemp |
503 |
|
|
504 |
|
ifneq "$(words $(CppFiles))" "0" |
498 |
– |
$(Print) Make dependencies for $(CppFiles) |
499 |
– |
$(Print) $(CppCompiler) $(IncludePath) -MM $(CppFiles) > Make.cpptemp |
505 |
|
$(CppCompiler) $(IncludePath) -MM $(CppFiles) > Make.cpptemp |
506 |
|
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
507 |
|
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
508 |
|
endif |
509 |
|
|
510 |
|
ifneq "$(words $(CFiles))" "0" |
506 |
– |
$(Print) Make dependencies for $(CFiles) |
507 |
– |
$(Print) $(CCompiler) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp |
511 |
|
$(CCompiler) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp |
512 |
|
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
513 |
|
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
515 |
|
endif |
516 |
|
|
517 |
|
ifneq "$(words $(F90Files))" "0" |
518 |
< |
$(Print) Make dependencies for $(F90Files) |
519 |
< |
$(DEV_ROOT)/scripts/sfmakedepend -I $(DEV_ROOT)/src -d '$$(DEV_ROOT)/obj' -f ./Make.ftemp -h *.F90 |
518 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/obj/' -D__F90 *.F90 > Make.ftemp |
519 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/MPIobj/' -DIS_MPI -D__F90 *.F90 >> Make.ftemp |
520 |
|
cat Make.ftemp >> $(DependencyFile) |
521 |
|
endif |
522 |
|
$(Delete) Make.cpptemp Make.ctemp Make.ftemp |