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 |
> |
LibList = $(LocalLibs:%=-l%) $(Libraries) |
225 |
|
|
226 |
|
|
227 |
|
#--------------------------------------------------------------------------- |
259 |
|
Lex = @LEX@ |
260 |
|
|
261 |
|
|
262 |
< |
MakeOptions = -k -s |
262 |
> |
MakeOptions = -k |
263 |
|
MakeDependOptions = |
264 |
|
StaticArchiverOptions = rc |
265 |
|
DynamicArchiverOptions = -shared |
267 |
|
JniOptions = |
268 |
|
RmiOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
269 |
|
-sourcepath $(SourceDir) |
270 |
+ |
COptions = $(FrcDeclare) |
271 |
+ |
CParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
272 |
+ |
CppOptions = $(FrcDeclare) |
273 |
+ |
CppParallelOptions = $(FrcDeclare) $(ParallelDeclare) |
274 |
|
FortranOptions = |
275 |
< |
F90Options = -I$(SourceDir) -module $(TargetDir) |
275 |
> |
F90Options = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir) |
276 |
> |
F90ParallelOptions = @PREPFLAG@ @F90FLAGS@ @MODDIRFLAG@$(SourceDir) -module $(TargetDir) @PREPDEFFLAG@$(ParallelDeclare) |
277 |
|
JavaCompilerOptions = -d $(TargetDir) -classpath $(ClassPath) \ |
278 |
|
-sourcepath $(SourceDir) -deprecation |
279 |
|
JavaRunOptions = -classpath $(ClassPath) |
314 |
|
# .c -> .o |
315 |
|
$(PackageTargetDir)/%.o : %.c |
316 |
|
$(Print) $@ |
317 |
< |
$(Print) $(CCompiler) $(COptions) -c $(IncludePath) $< -o $@ |
296 |
< |
@$(CCompiler) $(COptions) -c $(IncludePath) $< -o $@ |
317 |
> |
$(CCompiler) $(COptions) -c $(IncludePath) $< -o $@ |
318 |
|
|
319 |
|
%.o : %.c |
320 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
321 |
|
|
322 |
|
# .cpp -> .o |
323 |
|
$(PackageTargetDir)/%.o : %.cpp |
303 |
– |
$(Print) $@ |
304 |
– |
$(Print) $(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@ |
324 |
|
$(CppCompiler) $(CppOptions) -c $(IncludePath) $< -o $@ |
325 |
|
|
326 |
|
%.o : %.cpp |
328 |
|
|
329 |
|
# .f -> .o |
330 |
|
$(PackageTargetDir)/%.o : %.f |
331 |
< |
$(Print) $@ |
313 |
< |
$(Print) $(FortranCompiler) $(FortranOptions) -c $< -o $@ |
314 |
< |
@$(FortranCompiler) $(FortranOptions) -c $< -o $@ |
331 |
> |
$(FortranCompiler) $(FortranOptions) -c $< -o $@ |
332 |
|
|
333 |
|
%.o : %.f |
334 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
335 |
|
|
336 |
|
# .F90 -> .o |
337 |
|
$(PackageTargetDir)/%.o : %.F90 |
338 |
< |
$(Print) $@ |
322 |
< |
$(Print) $(F90Compiler) $(F90Options) -c $< -o $@ |
323 |
< |
@$(F90Compiler) $(F90Options) -c $< -o $@ |
338 |
> |
$(F90Compiler) $(F90Options) -c $< -o $@ |
339 |
|
|
340 |
|
%.o : %.F90 |
341 |
|
$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
342 |
|
|
343 |
|
# .java -> .class |
344 |
|
$(PackageTargetDir)/%.class : $(PackageSourceDir)/%.java |
345 |
< |
$(Print) $@ |
331 |
< |
$(Print) $(JavaCompiler) $(JavaCompilerOptions) $< |
332 |
< |
@$(JavaCompiler) $(JavaCompilerOptions) $< |
345 |
> |
$(JavaCompiler) $(JavaCompilerOptions) $< |
346 |
|
|
347 |
|
%.class : $(PackageSourceDir)/%.java |
348 |
|
@$(MAKE) $(MakeOptions) $(PackageTargetDir)/$@ |
349 |
|
|
350 |
|
# .class -> .h |
351 |
|
$(PackageSourceDir)/%.h : $(PackageTargetDir)/%.class |
339 |
– |
$(Print) $@ |
340 |
– |
$(Print) $(JniCompiler) $(JniOptions) $(JavaPackageName).$* |
352 |
|
$(JniCompiler) $(JniOptions) $(JavaPackageName).$* |
353 |
|
|
354 |
|
%.h : %.class |
356 |
|
|
357 |
|
#.y -> .h |
358 |
|
%.h : %.y |
359 |
< |
$(Print) $@ |
349 |
< |
$(Print) @$(Yacc) -d $? |
350 |
< |
@$(Yacc) -d $? |
359 |
> |
$(Yacc) -d $? |
360 |
|
@$(Move) y.tab.h $*.h |
361 |
|
@$(Delete) y.tab.c |
362 |
|
|
363 |
|
#.y -> .c |
364 |
|
%.c : %.y |
365 |
< |
$(Print) $@ |
357 |
< |
$(Print) $(Yacc) -d $? |
358 |
< |
@$(Yacc) -d $? |
365 |
> |
$(Yacc) -d $? |
366 |
|
@$(Move) y.tab.c $*.c |
367 |
|
@$(Delete) y.tab.h |
368 |
|
|
374 |
|
|
375 |
|
# .o -> .a |
376 |
|
$(LibDir)/%.a : $(ObjectFiles) |
377 |
< |
$(Print) $@ |
371 |
< |
$(Print) $(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles) |
372 |
< |
@$(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles) |
377 |
> |
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ObjectFiles) |
378 |
|
|
379 |
|
%.a : $(ObjectFiles) |
380 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
381 |
|
|
382 |
|
$(LibDir)/%_MPI.a : $(ParallelObjectFiles) |
383 |
< |
$(Print) $@ |
379 |
< |
$(Print) $(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles) |
380 |
< |
@$(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles) |
383 |
> |
$(StaticArchiver) $(StaticArchiverOptions) $@ $(ParallelObjectFiles) |
384 |
|
|
385 |
|
%_MPI.a : $(ParallelObjectFiles) |
386 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
387 |
|
|
388 |
|
# .o -> .so |
389 |
|
$(LibDir)/%.so : $(ObjectFiles) |
387 |
– |
$(Print) $@ |
388 |
– |
$(Print) $(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@ |
390 |
|
$(DynamicArchiver) $(ObjectFiles) $(DynamicArchiverOptions) -o $@ |
391 |
|
|
392 |
|
%.so : $(ObjectFiles) |
393 |
|
$(MAKE) $(MakeOptions) $(LibDir)/$@ |
394 |
|
|
395 |
|
$(LibDir)/%_MPI.so : $(ParallelObjectFiles) |
395 |
– |
$(Print) $@ |
396 |
– |
$(Print) $(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@ |
396 |
|
$(DynamicArchiver) $(ParallelObjectFiles) $(DynamicArchiverOptions) -o $@ |
397 |
|
|
398 |
|
%_MPI.so : $(ParallelObjectFiles) |
401 |
|
# .class -> .jar |
402 |
|
$(LibDir)/%.jar : $(JavaClassFiles) $(OtherTargetFiles) |
403 |
|
$(Print) $@ |
405 |
– |
$(Print) $(JavaArchiver) -cf $@ $(JavaClassFilesRel) $(OtherTargetFiles) |
404 |
|
@cd $(TargetDir); $(JavaArchiver) -cf $@ \ |
405 |
|
$(JavaClassFilesRel) $(OtherTargetFiles) |
406 |
|
|
432 |
|
|
433 |
|
# Executable |
434 |
|
$(Executable) : $(ObjectFiles) |
437 |
– |
$(Print) $@ |
438 |
– |
$(Print) $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@ |
435 |
|
$(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ObjectFiles) -o $@ |
436 |
|
|
437 |
|
$(ParallelExecutable) : $(ParallelObjectFiles) |
442 |
– |
$(Print) $@ |
443 |
– |
$(Print) $(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ParallelObjectFiles) -o $@ |
438 |
|
$(Linker) $(LinkOptions) $(LibDirs) $(LibList) $(ParallelObjectFiles) -o $@ |
439 |
|
|
440 |
|
# Anything else is just copied from source to target |
460 |
|
$(StaticLibrary) \ |
461 |
|
$(JarFile) \ |
462 |
|
$(Executable) |
463 |
+ |
|
464 |
|
|
470 |
– |
|
465 |
|
# make clean |
466 |
|
clean : $(PackageListLoop) |
467 |
|
$(Print) Done clean. |
468 |
|
|
469 |
|
_cleanall : |
470 |
< |
$(Delete) $(PackageTargetDir)/* \ |
470 |
> |
$(Delete) $(ObjectFiles) $(ParallelObjectFiles) |
471 |
> |
|
472 |
> |
# make distclean |
473 |
> |
distclean : $(PackageListLoop) |
474 |
> |
$(Print) Done clean. |
475 |
> |
|
476 |
> |
_distcleanall : |
477 |
> |
$(Delete) $(ObjectFiles) \ |
478 |
> |
$(ParallelObjectFiles) \ |
479 |
|
$(JarFile) \ |
480 |
|
$(SharedLibrary) \ |
481 |
|
$(StaticLibrary) \ |
482 |
+ |
$(ParallelSharedLibrary) \ |
483 |
+ |
$(ParallelStaticLibrary) \ |
484 |
|
$(Executable) \ |
485 |
+ |
$(ParallelExecutable) \ |
486 |
|
$(DependencyFile) |
487 |
|
|
488 |
|
|
500 |
|
touch Make.ctemp |
501 |
|
|
502 |
|
ifneq "$(words $(CppFiles))" "0" |
498 |
– |
$(Print) Make dependencies for $(CppFiles) |
499 |
– |
$(Print) $(CppCompiler) $(IncludePath) -MM $(CppFiles) > Make.cpptemp |
503 |
|
$(CppCompiler) $(IncludePath) -MM $(CppFiles) > Make.cpptemp |
504 |
|
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
505 |
|
cat Make.cpptemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
506 |
|
endif |
507 |
|
|
508 |
|
ifneq "$(words $(CFiles))" "0" |
506 |
– |
$(Print) Make dependencies for $(CFiles) |
507 |
– |
$(Print) $(CCompiler) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp |
509 |
|
$(CCompiler) $(IncludePath) -MM $(CFiles) $(DerivedCFiles) > Make.ctemp |
510 |
|
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/obj\/&/g' >> $(DependencyFile) |
511 |
|
cat Make.ctemp | sed 's/^[a-zA-Z0-9]/$$\(DEV_ROOT\)\/MPIobj\/&/g' >> $(DependencyFile) |
513 |
|
endif |
514 |
|
|
515 |
|
ifneq "$(words $(F90Files))" "0" |
516 |
< |
$(Print) Make dependencies for $(F90Files) |
517 |
< |
$(DEV_ROOT)/scripts/sfmakedepend -I $(DEV_ROOT)/src -d '$$(DEV_ROOT)/obj' -f ./Make.ftemp -h *.F90 |
516 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/obj/' -D__F90 *.F90 > Make.ftemp |
517 |
> |
$(DEV_ROOT)/scripts/filepp -I $(DEV_ROOT)/src -od '$$(DEV_ROOT)/MPIobj/' -DIS_MPI -D__F90 *.F90 >> Make.ftemp |
518 |
|
cat Make.ftemp >> $(DependencyFile) |
519 |
|
endif |
520 |
|
$(Delete) Make.cpptemp Make.ctemp Make.ftemp |