Removed files for new Flugg structure
[u/mrichter/AliRoot.git] / Flugg / source / GNUmakefile
CommitLineData
1fcb989d 1# $ Id: GNUmakefile,v 1.26 2001/02/12 08:17:31 gcosmo Exp $
2# -----------------------------------------------------------------
3# "gmake" makes default libraries for each subdomain.
4# "gmake global" makes global libraries for each subdomain.
5# Composite libraries are built.
6# "gmake includes" places header files .h/.hh in $G4INCLUDE
7# "gmake libmap" forces rebuilding of map-file for granular libraries.
8# "gmake clean_libs" removes just archive (.a) and shared (.so) libraries
9# of current platform installation.
10# "gmake clean" removes installation of current platform.
11# "gmake clean_all" removes all platforms installations.
12#
13# (The .o files(s) are made by implicit rules.)
14
15MAKEFLAGS= --no-print-directory
16
17SUBDIR1 = dummyG4 Wrappers
18
19ifndef FLUGGINSTALL
20 FLUGGINSTALL = ..
21endif
22
23include $(FLUGGINSTALL)/config/architecture.gmk
24G4BINDIR := $(G4BIN)/$(G4SYSTEM)
25G4LIBDIR := $(G4LIB)/$(G4SYSTEM)
26G4TMPDIR := $(G4TMP)/$(G4SYSTEM)
27unique := $(shell echo $$$$)
28
29.PHONY: all glob global libmap includes clean_libs clean clean_all
30
31all:
32ifdef G4USE_HEPODBMS
33 @$(ECHO) Making granular libraries with HepODBMS option ...
34 @for dir in $(SUBDIR4); do (cd $$dir && $(MAKE) cleandb); done;:
35 @if [ ! -f $(G4TMPDIR)/schema/G4SCHEMA ] ; then \
36 $(ECHO) "Temporary boot file does not exist. Stop." ; exit 1 ; \
37 fi
38endif
39 @for dir in $(SUBDIR1); do (cd $$dir && $(MAKE)); done;:
40 @for dir in $(SUBDIR2); do (cd $$dir && $(MAKE)); done;:
41 @for dir in $(SUBDIR3); do (cd $$dir && $(MAKE)); done;:
42ifdef G4USE_HEPODBMS
43 @for dir in $(SUBDIR4); do (cd $$dir && $(MAKE)); done;:
44endif
45 #$(MAKE) libmap
46
47glob global:
48ifdef G4USE_HEPODBMS
49 @$(ECHO) Making global libraries with HepODBMS option ...
50 @for dir in $(SUBDIR4); do (cd $$dir && $(MAKE) cleandb); done;:
51 @if [ ! -f $(G4TMPDIR)/schema/G4SCHEMA ] ; then \
52 $(ECHO) "Temporary boot file does not exist. Stop." ; exit 1 ; \
53 fi
54endif
55 @for dir in $(SUBDIR1); do (cd $$dir && $(MAKE) global); done;:
56 @for dir in $(SUBDIR2); do (cd $$dir && $(MAKE)); done;:
57 @for dir in $(SUBDIR3); do (cd $$dir && $(MAKE)); done;:
58ifdef G4USE_HEPODBMS
59 @for dir in $(SUBDIR4); do (cd $$dir && $(MAKE) global); done;:
60endif
61
62
63libmap: $(G4LIBDIR)/liblist
64 @echo "WARNING: Making a library map of granular libraries."
65 @echo " This is a list of libraries in order of use, and for"
66 @echo " each library a list of other libraries used."
67 @echo " To do this it needs a complete set of dependency"
68 @echo " files, e.g., after gmake in the source/ directory."
69 @echo "Searching $(FLUGGINSTALL)/source"
70 @echo ' for GNUmakefiles containing "name" and sorting...'
71 @find $(FLUGGINSTALL)/source \
72 -name GNUmakefile -exec $(GREP) -l '^ *name *:=' {} \; \
73 | sort \
74 > /tmp/G4_all_lib_makefiles.$(unique);
75 @echo "Weeding out /test[s]/, global level GNUmakefiles, etc..."
76 @for i in `cat /tmp/G4_all_lib_makefiles.$(unique)`; \
77 do \
78 echo $$i | $(GREP) -q '/tests\?/' || \
79 $(GREP) -q SUBDIR $$i || \
80 $(GREP) -q G4hepgeometry $$i || \
81 echo $$i >> /tmp/G4_granlib_makefiles.$(unique); \
82 done
83 @echo "Making libname.map starter file..."
84 @touch /tmp/G4libname.map.starter.$(unique);
85 @for i in `cat /tmp/G4_granlib_makefiles.$(unique)`; \
86 do \
87 $(GREP) '^ *name *:=' $$i | cut -d \ -f 3 \
88 >> /tmp/G4libname.map.starter.$(unique); \
89 echo $$i >> /tmp/G4libname.map.starter.$(unique); \
90 done
91 @echo "Making libname.map..."
92 @rm -f $(G4LIBDIR)/libname.map;
93 @G4TMP=$(G4TMP); export G4TMP; \
94 $(G4LIBDIR)/liblist -l -d $(G4TMPDIR) \
95 < /tmp/G4libname.map.starter.$(unique) \
96 > $(G4LIBDIR)/libname.map
97 @rm -f /tmp/G4_all_lib_makefiles.$(unique);
98 @rm -f /tmp/G4_granlib_makefiles.$(unique);
99 @rm -f /tmp/G4libname.map.starter.$(unique);
100
101$(G4LIBDIR)/liblist: $(FLUGGINSTALL)/config/liblist.c
102 @echo "Compiling liblist.c..."
103 @if [ ! -d $(G4LIBDIR) ] ; then mkdir $(G4LIBDIR) ;fi
104 $(CC) $(CCFLAGS) -o $(G4LIBDIR)/liblist $(FLUGGINSTALL)/config/liblist.c
105
106includes:
107 @echo Installing includes files in $(G4INCLUDE) ...
108 @for dir in $(SUBDIR1); do (cd $$dir && $(MAKE) $@); done
109 @for dir in $(SUBDIR2); do (cd $$dir && $(MAKE) $@); done
110 @for dir in $(SUBDIR3); do (cd $$dir && $(MAKE) $@); done
111
112clean_libs:
113 @echo Removing all libraries ...
114 @for dir in $(SUBDIR1); do (cd $$dir && $(MAKE) clean_libs); done
115 @for dir in $(SUBDIR2); do (cd $$dir && $(MAKE) clean_libs); done
116 @for dir in $(SUBDIR3); do (cd $$dir && $(MAKE) clean_libs); done
117 @rm -rf $(G4LIBDIR)/libname.map
118
119clean:
120 @echo Removing current $(G4SYSTEM) installation ...
121 @rm -rf $(G4TMPDIR)
122 @rm -rf $(G4LIBDIR)
123 @rm -rf $(G4BINDIR)
124ifdef CFRONT
125 @rm -rf $(G4TREP)
126endif
127
128# Pay _extremely_ attention before executing the following target !!
129#
130clean_all:
131 @echo Removing all installations ...
132 @echo Removing $(G4TMP) ...
133 @rm -rf $(G4TMP)
134 @echo Removing $(G4LIB) ...
135 @rm -rf $(G4LIB)
136 @echo Removing $(G4BIN) ...
137 @rm -rf $(G4BIN)
138 @echo Removing $(G4INCLUDE) ...
139 @rm -rf $(G4INCLUDE)