source: trunk/doc/genMakefile.tcl@ 4

Last change on this file since 4 was 2, checked in by Pavel Demin, 16 years ago

first commit

  • Property svn:executable set to *
File size: 17.4 KB
Line 
1#!/usr/bin/env tclsh
2
3set prefix "tmp/"
4set suffix " \\\n\t"
5
6set srcSuf {.$(SrcSuf)}
7set objSuf {.$(ObjSuf)}
8set exeSuf {$(ExeSuf)}
9
10proc dependencies {fileName firstLine {force 1} {command {}}} {
11 global suffix headerFiles sourceFiles
12
13 if {[info exists sourceFiles($fileName)]} return
14
15 set sourceFiles($fileName) 1
16
17 set list {}
18 set fid [open $fileName]
19 while {! [eof $fid]} {
20 set line [gets $fid]
21 if [regexp -- {^\s*#include\s*"((\w+/)+\w+\.(h|hh))"} $line] {
22 set elements [split $line {"}]
23 set file [lindex $elements 1]
24 if [file exists $file] {
25 lappend list $file
26 set headerFiles($file) 1
27 }
28 }
29 }
30
31 if {[llength $list] > 0} {
32 puts -nonewline $firstLine
33 foreach file $list {puts -nonewline $suffix$file}
34 if {$command != {}} {
35 puts ""
36 puts $command
37 }
38 puts ""
39 } elseif {$force} {
40 puts -nonewline $firstLine
41 if {$command != {}} {
42 puts ""
43 puts $command
44 }
45 puts ""
46 }
47
48 close $fid
49}
50
51proc dictDeps {dictVar args} {
52
53 global prefix suffix srcSuf objSuf
54
55 set dict [eval glob -nocomplain $args]
56
57 set dictSrcFiles {}
58 set dictObjFiles {}
59
60 foreach fileName $dict {
61 regsub {LinkDef\.h} $fileName {Dict} dictName
62 set dictName $prefix$dictName
63
64 lappend dictSrcFiles $dictName$srcSuf
65 lappend dictObjFiles $dictName$objSuf
66
67 dependencies $fileName "$dictName$srcSuf:$suffix$fileName"
68 }
69
70 puts -nonewline "${dictVar} = $suffix"
71 puts [join $dictSrcFiles $suffix]
72 puts ""
73
74 puts -nonewline "${dictVar}_OBJ = $suffix"
75 puts [join $dictObjFiles $suffix]
76 puts ""
77
78}
79
80proc sourceDeps {srcPrefix args} {
81
82 global prefix suffix srcSuf objSuf
83
84 set source [eval glob -nocomplain $args]
85
86 set srcObjFiles {}
87
88 foreach fileName $source {
89 regsub {\.cc} $fileName {} srcName
90 set srcObjName $prefix$srcName
91
92 lappend srcObjFiles $srcObjName$objSuf
93
94 dependencies $fileName "$srcObjName$objSuf:$suffix$srcName$srcSuf"
95 }
96
97 puts -nonewline "${srcPrefix}_OBJ = $suffix"
98 puts [join $srcObjFiles $suffix]
99 puts ""
100}
101
102proc tclDeps {} {
103
104 global prefix suffix srcSuf objSuf
105
106 set source [glob -nocomplain {tcl/*.c}]
107
108 set srcObjFiles {}
109
110 foreach fileName $source {
111 if {$fileName == "tcl/tclc.c" || $fileName == "tcl/tcl.c"} continue
112
113 regsub {\.c} $fileName {} srcName
114 set srcObjName $prefix$srcName
115
116 lappend srcObjFiles $srcObjName$objSuf
117
118 dependencies $fileName "$srcObjName$objSuf:$suffix$fileName"
119 }
120
121 puts -nonewline "TCL_OBJ = $suffix"
122 puts [join $srcObjFiles $suffix]
123 puts ""
124}
125
126proc stdhepDeps {} {
127
128 global prefix suffix srcSuf objSuf
129
130 set source [glob -nocomplain {mcfio/*.c} {stdhep/*.c}]
131
132 set srcObjFiles {}
133
134 foreach fileName $source {
135 regsub {\.c} $fileName {} srcName
136 set srcObjName $prefix$srcName
137
138 lappend srcObjFiles $srcObjName$objSuf
139
140 dependencies $fileName "$srcObjName$objSuf:$suffix$fileName"
141 }
142
143 puts -nonewline "STDHEP_OBJ = $suffix"
144 puts [join $srcObjFiles $suffix]
145 puts ""
146}
147
148proc stdhepExecutableDeps {} {
149
150 global prefix suffix objSuf exeSuf
151
152 set executable [glob -nocomplain {test/ExRootSTDHEPConverter.cpp} \
153 {test/MatchingSTDHEPConverter.cpp}]
154
155 set exeFiles {}
156
157 foreach fileName $executable {
158 regsub {\.cpp} $fileName {} exeObjName
159 set exeObjName $prefix$exeObjName
160 set exeName [file tail $exeObjName]
161
162 lappend exeFiles $exeName$exeSuf
163 lappend exeObjFiles $exeObjName$objSuf
164
165 puts "$exeName$exeSuf:$suffix$exeObjName$objSuf"
166 puts ""
167
168 dependencies $fileName "$exeObjName$objSuf:$suffix$fileName"
169 }
170
171 if [info exists exeFiles] {
172 puts -nonewline "STDHEP_EXECUTABLE = $suffix"
173 puts [join $exeFiles $suffix]
174 puts ""
175 }
176 if [info exists exeObjFiles] {
177 puts -nonewline "STDHEP_EXECUTABLE_OBJ = $suffix"
178 puts [join $exeObjFiles $suffix]
179 puts ""
180 }
181
182}
183
184proc executableDeps {} {
185
186 global prefix suffix objSuf exeSuf
187
188 set executable [glob -nocomplain {test/*.cpp}]
189
190 set exeFiles {}
191
192 foreach fileName $executable {
193 if {$fileName == "test/ExRootSTDHEPConverter.cpp"} continue
194 if {$fileName == "test/MatchingSTDHEPConverter.cpp"} continue
195 regsub {\.cpp} $fileName {} exeObjName
196 set exeObjName $prefix$exeObjName
197 set exeName [file tail $exeObjName]
198
199 lappend exeFiles $exeName$exeSuf
200 lappend exeObjFiles $exeObjName$objSuf
201
202 puts "$exeName$exeSuf:$suffix$exeObjName$objSuf"
203 puts ""
204
205 dependencies $fileName "$exeObjName$objSuf:$suffix$fileName"
206 }
207
208 if [info exists exeFiles] {
209 puts -nonewline "EXECUTABLE = $suffix"
210 puts [join $exeFiles $suffix]
211 puts ""
212 }
213 if [info exists exeObjFiles] {
214 puts -nonewline "EXECUTABLE_OBJ = $suffix"
215 puts [join $exeObjFiles $suffix]
216 puts ""
217 }
218
219}
220
221proc headerDeps {} {
222 global suffix headerFiles
223
224 foreach fileName [array names headerFiles] {
225 dependencies $fileName "$fileName:" 0 "\t@touch \$@"
226 }
227}
228
229puts {
230#
231# Makefile for ExRootAnalysis
232#
233# Author: P. Demin - UCL, Louvain-la-Neuve
234#
235# multi-platform configuration is taken from ROOT (root/test/Makefile)
236#
237
238ARCH = $(shell root-config --arch)
239
240CXX =
241ObjSuf = o
242SrcSuf = cc
243ExeSuf =
244DllSuf = so
245LibSuf = a
246OutPutOpt = -o # keep whitespace after "-o"
247
248ROOTCFLAGS := $(shell root-config --cflags)
249ROOTLIBS := $(shell root-config --libs)
250ROOTGLIBS := $(shell root-config --glibs)
251
252ifeq ($(ARCH),win32)
253PLATFORM = win32
254endif
255ifeq ($(ARCH),win32gdk)
256PLATFORM = win32
257endif
258
259ifeq ($(ARCH),hpux)
260# HP-UX with CC
261CXX = CC
262CXXFLAGS = -O +Z
263LD = CC
264LDFLAGS= -O +a1 -z
265SOFLAGS= -b
266DllSuf = sl
267endif
268
269ifeq ($(ARCH),hpuxacc)
270# HP-UX 10.x with aCC
271CXX = aCC
272CXXFLAGS = -O +Z
273LD = aCC
274LDFLAGS= -O -z
275SOFLAGS= -b
276endif
277
278ifeq ($(ARCH),hpuxia64acc)
279# HP-UX 11i 1.5 (IA-64) with aCC
280CXX = aCC
281CXXFLAGS = +DD64 -O +Z
282LD = aCC
283LDFLAGS= +DD64 -O -z
284SOFLAGS= -b
285endif
286
287ifeq ($(ARCH),hpuxegcs)
288# HP-UX 10.x with g++
289CXXFLAGS = -O -fPIC
290CXX = g++
291LD = g++
292LDFLAGS= -O
293SOFLAGS= -fPIC -shared
294endif
295
296
297ifeq ($(ARCH),hurddeb)
298# GNU/Hurd
299CXX = g++
300CXXFLAGS = -O -Wall -fPIC
301LD = g++
302LDFLAGS= -O
303SOFLAGS= -shared
304endif
305
306ifeq ($(ARCH),aix)
307# IBM AIX xlC 4.x
308CXX = xlC
309CXXFLAGS = -O
310LD = xlC
311LDFLAGS= -O
312SOFLAGS=
313ROOTLIBS := $(shell root-config --nonew --libs)
314ROOTGLIBS := $(shell root-config --nonew --glibs)
315endif
316
317ifeq ($(ARCH),aix5)
318# IBM AIX xlC 5.x
319CXX = xlC
320CXXFLAGS = -O
321LD = xlC
322LDFLAGS= -O
323SOFLAGS=
324ROOTLIBS := $(shell root-config --nonew --libs)
325ROOTGLIBS := $(shell root-config --nonew --glibs)
326endif
327
328ifeq ($(ARCH),aixegcs)
329# IBM AIX with GCC
330CXX = g++
331CXXFLAGS = -O
332LD = g++
333LDFLAGS= -O
334SOFLAGS= -shared
335endif
336
337ifeq ($(ARCH),solaris)
338# Solaris CC
339CXX = /opt/SUNWspro/bin/CC
340CXXFLAGS = -O -KPIC
341LD = /opt/SUNWspro/bin/CC
342LDFLAGS= -O
343SOFLAGS= -G
344endif
345
346ifeq ($(ARCH),solarisCC5)
347# Solaris CC 5.0
348CXX = CC
349CXXFLAGS = -O -KPIC
350LD = CC
351LDFLAGS= -O
352SOFLAGS= -G
353endif
354
355ifeq ($(ARCH),solarisegcs)
356# Solaris egcs
357CXX = g++
358CXXFLAGS = -O -fPIC
359LD = CC
360LDFLAGS= -O
361SOFLAGS= -shared
362endif
363
364ifeq ($(ARCH),solarisgcc)
365# Solaris gcc
366CXX = g++
367CXXFLAGS = -O -fPIC
368LD = g++
369LDFLAGS= -O
370SOFLAGS= -shared
371endif
372
373ifeq ($(ARCH),solariskcc)
374# Solaris kcc
375CXX = KCC --one_instantiation_per_object
376CXXFLAGS = -O4 -KPIC
377LD = KCC
378LDFLAGS= -O4
379SOFLAGS=
380endif
381
382ifeq ($(ARCH),solarisx86)
383# Solaris CC on Intel
384CXX = CC
385CXXFLAGS = -O -KPIC
386LD = CC
387LDFLAGS= -O
388SOFLAGS= -G
389endif
390
391ifeq ($(ARCH),sgicc)
392# SGI
393CXX = CC -n32 -I/usr/include/CC.sgi
394CXXFLAGS = -O
395LD = CC -n32 -I/usr/include/CC.sgi
396LDFLAGS= -O
397SOFLAGS= -shared
398endif
399
400ifeq ($(ARCH),sgiegcs)
401# SGI 6.x with EGCS
402CXX = g++
403CXXFLAGS = -O -Wall -fPIC
404LD = g++
405LDFLAGS= -O -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv
406SOFLAGS= -shared
407endif
408
409ifeq ($(ARCH),sgin32egcs)
410# SGI 6.x with EGCS for n32 ABI
411CXX = g++
412CXXFLAGS = -O -Wall -fPIC
413LD = g++
414LDFLAGS= -O -L/usr/lib32 -Wl,-woff,134
415SOFLAGS= -shared
416endif
417
418ifeq ($(ARCH),sgigcc)
419# SGI with GCC
420CXX = g++
421CXXFLAGS = -O -Wall -fPIC
422LD = g++
423LDFLAGS= -O -Wl,-u,__builtin_new -Wl,-u,__builtin_delete -Wl,-u,__nw__FUiPv
424SOFLAGS= -shared
425endif
426
427ifeq ($(ARCH),sgikcc)
428# SGI with KCC
429CXX = KCC -n32 --one_instantiation_per_object
430CXXFLAGS = -O
431LD = KCC -n32
432LDFLAGS= -O
433SOFLAGS=
434endif
435
436ifeq ($(ARCH),alphagcc)
437# Alpha/OSF with g++
438CXX = g++
439CXXFLAGS = -O -Wall -fPIC
440LD = g++
441LDFLAGS= -O
442SOFLAGS= -Wl,-expect_unresolved,* -shared
443endif
444
445ifeq ($(ARCH),alphaegcs)
446# Alpha/OSF with egcs
447CXX = g++
448CXXFLAGS = -O -Wall -fPIC
449LD = g++
450LDFLAGS= -O
451SOFLAGS= -Wl,-expect_unresolved,* -shared
452endif
453
454ifeq ($(ARCH),alphakcc)
455# Alpha/OSF with kai compiler (not yet valid)
456CXX = KCC --one_instantiation_per_object
457CXXFLAGS = -O -fPIC
458LD = KCC
459LDFLAGS= -O
460SOFLAGS= -Wl,-expect_unresolved,* -shared
461endif
462
463ifeq ($(ARCH),alphacxx6)
464# Alpha/OSF with cxx6
465CXX = cxx
466CXXFLAGS = -O
467LD = cxx
468LDFLAGS= -O
469SOFLAGS= -shared -nocxxstd -Wl,-expect_unresolved,*,-msym
470endif
471
472ifeq ($(ARCH),alphacxx)
473# Alpha/OSF with cxx5
474CXX = cxx
475CXXFLAGS = -O
476LD = cxx
477LDFLAGS= -O
478SOFLAGS= -Wl,-expect_unresolved,* -call_shared
479endif
480
481ifeq ($(ARCH),linuxrh51)
482# Linux with gcc 2.7.2.x
483CXX = g++
484CXXFLAGS = -O -Wall -fPIC
485LD = g++
486LDFLAGS= -O
487SOFLAGS= -shared
488AR = ar
489ARFLAGS = cru
490RANLIB = ranlib
491endif
492
493ifeq ($(ARCH),linuxrh42)
494# Linux with gcc 2.7.2.x (RedHat 4.2)
495CXX = g++
496CXXFLAGS = -O -Wall -fPIC
497LD = g++
498LDFLAGS= -O
499SOFLAGS= -shared
500AR = ar
501ARFLAGS = cru
502RANLIB = ranlib
503endif
504
505ifeq ($(ARCH),linuxdeb)
506# Linux with gcc 2.7.2.x
507CXX = g++
508CXXFLAGS = -O -Wall -fPIC
509LD = g++
510LDFLAGS= -O
511SOFLAGS= -shared
512AR = ar
513ARFLAGS = cru
514RANLIB = ranlib
515endif
516
517ifeq ($(ARCH),linuxdeb2)
518# Linux with gcc 2.7.2.x
519CXX = g++
520CXXFLAGS = -O -Wall -fPIC
521LD = g++
522LDFLAGS= -O
523SOFLAGS= -shared
524AR = ar
525ARFLAGS = cru
526RANLIB = ranlib
527endif
528
529ifeq ($(ARCH),linuxdeb2ppc)
530# Debian/Linux on the PowerPC
531CXX = g++
532CXXFLAGS = -O -Wall -fPIC
533LD = g++
534LDFLAGS= -O
535SOFLAGS= -shared
536AR = ar
537ARFLAGS = cru
538RANLIB = ranlib
539endif
540
541
542ifeq ($(ARCH),linuxsuse6)
543# Linux with gcc 2.7.2.x
544CXX = g++
545CXXFLAGS = -O -Wall -fPIC
546LD = g++
547LDFLAGS= -O
548SOFLAGS= -shared
549AR = ar
550ARFLAGS = cru
551RANLIB = ranlib
552endif
553
554ifeq ($(ARCH),linux)
555# Linux with egcs, gcc 2.9x, gcc 3.x (>= RedHat 5.2)
556CXX = g++
557CXXFLAGS = -O -Wall -fPIC
558LD = g++
559LDFLAGS= -O
560SOFLAGS= -shared
561AR = ar
562ARFLAGS = cru
563RANLIB = ranlib
564endif
565
566ifeq ($(ARCH),linuxkcc)
567# Linux with the KAI compiler
568CXX = KCC --one_instantiation_per_object
569CXXFLAGS = -fPIC +K0
570LD = KCC
571LDFLAGS= -O $(shell root-config --cflags)
572SOFLAGS=
573AR = ar
574ARFLAGS = cru
575RANLIB = ranlib
576endif
577
578ifeq ($(ARCH),linuxicc)
579# Linux with Intel icc compiler
580CXX = icc
581CXXFLAGS = -O
582LD = icc
583LDFLAGS= -O
584SOFLAGS= -shared
585AR = ar
586ARFLAGS = cru
587RANLIB = ranlib
588endif
589
590ifeq ($(ARCH),linuxppcegcs)
591# MkLinux with egcs/glibc
592CXX = g++
593CXXFLAGS = -O -Wall -fPIC
594LD = g++
595LDFLAGS= -O
596SOFLAGS= -shared
597AR = ar
598ARFLAGS = cru
599RANLIB = ranlib
600endif
601
602ifeq ($(ARCH),linuxia64gcc)
603# Itanium Linux with gcc 2.9x
604CXX = g++
605CXXFLAGS = -O -Wall -fPIC
606LD = g++
607LDFLAGS= -O
608SOFLAGS= -shared
609AR = ar
610ARFLAGS = cru
611RANLIB = ranlib
612endif
613
614ifeq ($(ARCH),linuxia64sgi)
615# Itanium Linux with sgiCC
616CXX = sgiCC
617CXXFLAGS = -O -Wall -fPIC
618LD = gsgiCC
619LDFLAGS= -O
620SOFLAGS= -shared
621AR = ar
622ARFLAGS = cru
623RANLIB = ranlib
624endif
625
626ifeq ($(ARCH),linuxia64ecc)
627# Itanium Linux with Intel ecc
628CXX = ecc
629CXXFLAGS = -O
630LD = ecc
631LDFLAGS= -O -i_dynamic
632SOFLAGS= -shared
633AR = ar
634ARFLAGS = cru
635RANLIB = ranlib
636endif
637
638ifeq ($(ARCH),linuxx8664gcc)
639# AMD Opteron (64 bit mode) Linux with gcc 3.x
640CXX = g++
641CXXFLAGS = -O -Wall -fPIC
642LD = g++
643LDFLAGS= -O
644SOFLAGS= -shared
645AR = ar
646ARFLAGS = cru
647RANLIB = ranlib
648endif
649
650ifeq ($(ARCH),linuxalphaegcs)
651# Alpha Linux with egcs
652CXX = g++
653CXXFLAGS = -O -Wall -fPIC
654LD = g++
655LDFLAGS= -O
656SOFLAGS= -shared
657AR = ar
658ARFLAGS = cru
659RANLIB = ranlib
660endif
661
662ifeq ($(ARCH),linuxarm)
663# ARM Linux with egcs
664CXX = g++
665CXXFLAGS = -O -Wall -fPIC
666LD = g++
667LDFLAGS= -O
668SOFLAGS= -shared
669AR = ar
670ARFLAGS = cru
671RANLIB = ranlib
672endif
673
674ifeq ($(ARCH),mklinux)
675# MkLinux with libc5
676CXX = g++
677CXXFLAGS = -O -Wall -fPIC
678LD = g++
679LDFLAGS= -O
680SOFLAGS= -shared
681AR = ar
682ARFLAGS = cru
683RANLIB = ranlib
684endif
685
686ifeq ($(ARCH),freebsd)
687# FreeBSD with libc5
688CXX = g++
689CXXFLAGS = -O -pipe -W -Wall -fPIC
690LD = g++
691LDFLAGS= -O
692SOFLAGS= -shared -Wl,-x
693AR = ar
694ARFLAGS = cru -crv
695RANLIB = ranlib
696endif
697
698ifeq ($(ARCH),freebsd4)
699# FreeBSD with glibc
700CXX = g++
701CXXFLAGS = -O -pipe -W -Wall -fPIC
702LD = g++
703LDFLAGS= -O
704SOFLAGS= -shared -Wl,-x
705AR = ar
706ARFLAGS = cru -crv
707RANLIB = ranlib
708endif
709
710ifeq ($(ARCH),macosx)
711# MacOS X with cc (GNU cc 2.95.2)
712CXX = c++
713CXXFLAGS = -O -pipe -Wall
714LD = c++
715LDFLAGS= -O -Xlinker -bind_at_load -flat_namespace
716# The SOFLAGS will be used to create the .dylib; the .so will
717# be created separately
718DllSuf = dylib
719SOFLAGS= -dynamiclib -flat_namespace -undefined suppress
720AR = ar
721ARFLAGS = cru -crv
722RANLIB = ranlib
723endif
724
725ifeq ($(ARCH),hiux)
726# Hitachi HIUX
727CXX = g++
728CXXFLAGS = -O2 -fPIC
729LD = g++
730LDFLAGS= -Wl,+s
731SOFLAGS= -Wl,-b,-E -nostdlib -nostartfiles
732DllSuf = sl
733endif
734
735ifeq ($(PLATFORM),win32)
736# Windows with the VC++ compiler
737ObjSuf = obj
738SrcSuf = cxx
739ExeSuf = .exe
740DllSuf = dll
741OutPutOpt = -out:
742CXX = cl
743CXXOPT = -O2
744#CXXOPT = -Z7
745CXXFLAGS = $(CXXOPT) -G5 -GR -GX -MD -DWIN32 -D_WINDOWS -nologo \
746 -DVISUAL_CPLUSPLUS -D_X86_=1 -D_DLL
747LD = link
748LDOPT = -opt:ref
749#LDOPT = -debug
750LDFLAGS= $(LDOPT) -pdb:none -nologo
751SOFLAGS= -DLL
752
753ROOTLIBS := $(shell root-config --nonew --libs)
754ROOTGLIBS := $(shell root-config --nonew --glibs)
755EXPLLINKLIBS = $(ROOTLIBS) $(ROOTGLIBS)
756endif
757
758ifeq ($(ARCH),win32gcc)
759# Windows with gcc
760DllSuf = dll
761ExeSuf = .exe
762CXX = g++
763CXXFLAGS = -O -Wall -Woverloaded-virtual -I/usr/X11R6/include
764LD = g++
765LDFLAGS= -O -Wl,--enable-auto-import
766SOFLAGS= -shared -D_DLL -Wl,--export-all-symbols
767EXPLLINKLIBS = $(ROOTLIBS) $(ROOTGLIBS)
768AR = ar
769ARFLAGS = cru
770RANLIB = ranlib
771endif
772
773ifeq ($(CXX),)
774$(error $(ARCH) invalid architecture)
775endif
776
777CXXFLAGS += $(ROOTCFLAGS) -DDROP_CGAL -I. -Itcl -Imcfio -Istdhep -ICDFCones -ICDFCones/CDFcode
778LIBS = $(ROOTLIBS) -lEG $(SYSLIBS)
779GLIBS = $(ROOTGLIBS) $(SYSLIBS)
780
781###
782
783STATIC = lib/libExRootAnalysisPGS.$(LibSuf)
784SHARED = lib/libExRootAnalysis.$(DllSuf)
785
786all:
787
788}
789
790stdhepExecutableDeps
791
792executableDeps
793
794dictDeps {DICT} {src/*LinkDef.h} {modules/*LinkDef.h}
795
796dictDeps {PGS_DICT} {pgs/*LinkDef.h}
797
798sourceDeps {SOURCE} {src/*.cc} {modules/*.cc} {CDFCones/*.cc} {KtJet/*.cc} {CLHEP/src/*.cc}
799
800sourceDeps {PGS_SOURCE} {src/ExRootClasses.cc} {src/ExRootTreeBranch.cc} {src/ExRootTreeWriter.cc}
801
802sourceDeps {PGS} {pgs/*.cc}
803
804stdhepDeps
805
806tclDeps
807
808headerDeps
809
810puts {
811
812###
813
814all: $(SHARED) $(EXECUTABLE) $(STDHEP_EXECUTABLE)
815
816static: $(STATIC)
817
818$(STATIC): $(PGS_DICT_OBJ) $(PGS_SOURCE_OBJ) $(PGS_OBJ)
819 @mkdir -p $(@D)
820 $(AR) $(ARFLAGS) $@ $^
821 $(RANLIB) $@
822
823$(SHARED): $(DICT_OBJ) $(SOURCE_OBJ) $(TCL_OBJ)
824 @mkdir -p $(@D)
825 @echo ">> Building $@"
826ifeq ($(ARCH),aix)
827 @/usr/ibmcxx/bin/makeC++SharedLib $(OutPutOpt)$@ $(LIBS) -p 0 $^
828else
829ifeq ($(ARCH),aix5)
830 @/usr/vacpp/bin/makeC++SharedLib $(OutPutOpt)$@ $(LIBS) -p 0 $^
831else
832ifeq ($(ARCH),macosx)
833# We need to make both the .dylib and the .so
834 @$(LD) $(SOFLAGS) $^ $(OutPutOpt)$@
835 @$(LD) -bundle -undefined suppress $(LDFLAGS) $^ $(LIBS) \
836 $(OutPutOpt)$(subst .$(DllSuf),.so,$@)
837else
838ifeq ($(PLATFORM),win32)
839 @bindexplib $* $^ > $*.def
840 @lib -nologo -MACHINE:IX86 $^ -def:$*.def \
841 $(OutPutOpt)$(EVENTLIB)
842 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \
843 $(OutPutOpt)$@
844else
845 @$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)
846endif
847endif
848endif
849endif
850
851clean:
852 @rm -f $(PGS_DICT_OBJ) $(PGS_SOURCE_OBJ) $(PGS_OBJ) $(DICT_OBJ) $(SOURCE_OBJ) $(TCL_OBJ) $(STDHEP_OBJ) core
853
854distclean: clean
855 @rm -f $(SHARED) $(STATIC) $(EXECUTABLE) $(STDHEP_EXECUTABLE)
856
857###
858
859.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)
860
861%Dict.$(SrcSuf):
862 @mkdir -p $(@D)
863 @echo ">> Generating $@"
864 @rootcint -f $@ -c $<
865 @echo "#define private public" > $@.arch
866 @echo "#define protected public" >> $@.arch
867 @mv $@ $@.base
868 @cat $@.arch $< $@.base > $@
869 @rm $@.arch $@.base
870
871$(SOURCE_OBJ): tmp/%.$(ObjSuf): %.$(SrcSuf)
872 @mkdir -p $(@D)
873 @echo ">> Compiling $<"
874 @$(CXX) $(CXXFLAGS) -c $< $(OutPutOpt)$@
875
876$(PGS_OBJ): tmp/%.$(ObjSuf): %.$(SrcSuf)
877 @mkdir -p $(@D)
878 @echo ">> Compiling $<"
879 @$(CXX) $(CXXFLAGS) -c $< $(OutPutOpt)$@
880
881$(DICT_OBJ): %.$(ObjSuf): %.$(SrcSuf)
882 @mkdir -p $(@D)
883 @echo ">> Compiling $<"
884 @$(CXX) $(CXXFLAGS) -c $< $(OutPutOpt)$@
885
886$(PGS_DICT_OBJ): %.$(ObjSuf): %.$(SrcSuf)
887 @mkdir -p $(@D)
888 @echo ">> Compiling $<"
889 @$(CXX) $(CXXFLAGS) -c $< $(OutPutOpt)$@
890
891$(TCL_OBJ): tmp/%.$(ObjSuf): %.c
892 @mkdir -p $(@D)
893 @echo ">> Compiling $<"
894 @gcc $(CXXFLAGS) -c $< $(OutPutOpt)$@
895
896$(STDHEP_OBJ): tmp/%.$(ObjSuf): %.c
897 @mkdir -p $(@D)
898 @echo ">> Compiling $<"
899 @gcc $(CXXFLAGS) -c $< $(OutPutOpt)$@
900
901$(STDHEP_EXECUTABLE_OBJ): tmp/%.$(ObjSuf): %.cpp
902 @mkdir -p $(@D)
903 @echo ">> Compiling $<"
904 @$(CXX) $(CXXFLAGS) -c $< $(OutPutOpt)$@
905
906$(STDHEP_EXECUTABLE): %$(ExeSuf): $(DICT_OBJ) $(SOURCE_OBJ) $(TCL_OBJ) $(STDHEP_OBJ)
907 @echo ">> Building $@"
908 @$(LD) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt)$@
909
910$(EXECUTABLE_OBJ): tmp/%.$(ObjSuf): %.cpp
911 @mkdir -p $(@D)
912 @echo ">> Compiling $<"
913 @$(CXX) $(CXXFLAGS) -c $< $(OutPutOpt)$@
914
915$(EXECUTABLE): %$(ExeSuf): $(DICT_OBJ) $(SOURCE_OBJ) $(TCL_OBJ)
916 @echo ">> Building $@"
917 @$(LD) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt)$@
918
919###
920
921}
Note: See TracBrowser for help on using the repository browser.