Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:00

0001 #!/bin/bash
0002 
0003 
0004 modules=$*
0005 
0006 function makegen
0007 {
0008     mod=$1
0009     cat >> gen.mk <<EOF
0010 
0011 # module.mk appends to FILES and DICTFILES
0012 FILES :=
0013 DICTFILES :=
0014 
0015 # including the module.mk file
0016 -include \$(patsubst %, %/module.mk,${mod})
0017 
0018 # appending the values found in FILES to the variable SRC
0019 SRC += \$(patsubst %,${mod}/%,\$(FILES))
0020 
0021 # appending the values found in DICTFILES to DICTH_modulename
0022 DICTH_${mod} := \$(foreach i, \$(patsubst %,${mod}/%,\$(DICTFILES)), \$(wildcard \$(i).h) \$(wildcard \$(i).hh))
0023 # if dict header files exist, append to variable SRC
0024 ifneq (\$(DICTH_${mod}),)
0025 SRC += ${mod}/\$(PKGNAME)_dict_${mod}
0026 endif
0027 
0028 PROG += \$(patsubst %,\$(BINDIR)/%,\$(PROGRAMS))
0029 
0030 # appending the values found in FILES to the variable SRC
0031 PROGSRC += \$(patsubst %,${mod}/%,\$(PROGRAMS))
0032 
0033 # VPATH += :${mod}
0034 
0035 # make sure the output directories are there
0036 __dummy := \$(shell mkdir -p \$(DEPDIR)/${mod} \$(OBJDIR)/${mod})
0037 
0038 # a couple of rules to copy executable files correctly
0039 \$(BINDIR)/%: ${mod}/%
0040         cp \$^ \$@
0041 
0042 #\$(BINDIR)/%: ${mod}/%.bin
0043 #       cp \$^ \$@
0044 
0045 \$(BINDIR)/%: ${mod}/bin/%
0046         cp \$^ \$@
0047 
0048 \$(BINDIR)/%: \${OBJDIR}/${mod}/%.bin
0049         cp \$^ \$@
0050 
0051 EOF
0052 }
0053 
0054 function makedictgen
0055 {
0056     mod=$1
0057     cat >> dictgen.mk <<EOF
0058 ${mod}/\$(PKGNAME)_dict_${mod}.cc: \$(DICTH_${mod})
0059         @echo "Generating dictionary \$@..."
0060         @\$(ROOTCINT) -f \$@ -c \$(filter -I% -D%,\$(CXXFLAGS)) \$^
0061 EOF
0062 }
0063 
0064 
0065 rm -f gen.mk dictgen.mk
0066 
0067 for i in $modules; do
0068     makegen $i
0069     makedictgen $i
0070 done
0071