Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / AliGeant4 / config / make_source_geom.pl
CommitLineData
70eaea82 1#!/usr/bin/perl
fd0ec155 2# $Id$
3# by I. Hrivnacova, 22.6. 2000
4#
5# This script creates source directory structured
6# according subcategories with links to the flat
7# source structure.
8
9# main categories (packages)
10@DIRLIST = "TGeant4";
11@DIRLIST = (@DIRLIST,"AliGeant4");
12@NAMELIST = "g4mc";
13@NAMELIST = (@NAMELIST,"alice");
14
15# subcategories
16@CATLIST = "global";
17@CATLIST = (@CATLIST,"geometry");
18
19# link source files and history files
20for ( $i = 0 ; $i < $#DIRLIST+1 ; $i++ ) {
21 $DIR = @DIRLIST[$i];
22 $NAME = @NAMELIST[$i];
23 $DIRPATH = $ENV{'AG4_INSTALL'} . "/../" . $DIR;
24 $TARGETPATH = $DIRPATH . "_geometry";
25
26 foreach $CAT (@CATLIST) {
27 chdir $DIRPATH;
28
29 $CATSTRING = "\"Category: " . $CAT . "\"";
30 @FILELIST_H = `find . -name \"*.h\" -exec grep -l $CATSTRING {} \\;`;
31 @FILELIST_ICC = `find . -name \"*.icc\" -exec grep -l $CATSTRING {} \\;`;
32 @FILELIST_CXX = `find . -name \"*.cxx\" -exec grep -l $CATSTRING {} \\;`;
33
34 print "Processing category: " . $CAT . "\n";
35
36 # .h files
37 chdir $TARGETPATH;
38 foreach $FILEPATH (@FILELIST_H) {
39 @TEMP = split('/',$FILEPATH);
40 $FILE = @TEMP[@TEMP - 1];
41 chop $FILE;
42 print " Linking file " . $FILE . "\n";
43 $FILEPATH = $DIRPATH . "/" . $FILE;
44 #print " Linking file " . $FILEPATH . " " . $FILE . "\n";
45 `ln -s $FILEPATH $FILE`;
46 }
47
48 # .icc files
49 foreach $FILEPATH (@FILELIST_ICC) {
50 @TEMP = split('/',$FILEPATH);
51 $FILE = @TEMP[@TEMP - 1];
52 chop $FILE;
53 print " Linking file " . $FILE . "\n";
54 $FILEPATH = $DIRPATH . "/" . $FILE;
55 #print " Linking file " . $FILEPATH . " " . $FILE . "\n";
56 `ln -s $FILEPATH $FILE`;
57 }
58
59 # .cxx files
60 foreach $FILEPATH (@FILELIST_CXX) {
61 @TEMP = split('/',$FILEPATH);
62 $FILE = @TEMP[@TEMP - 1];
63 chop $FILE;
64 print " Linking file " . $FILE . "\n";
65 $FILEPATH = $DIRPATH . "/" . $FILE;
66 #print " Linking file " . $FILEPATH . " " . $FILEDEST . "\n";
67 `ln -s $FILEPATH $FILE`;
68 }
69 }
70}
71