cflags = $(CFLAGS) cppflags = $(CFLAGS) fflags = $(CFLAGS) cc = cc ccomp = $(cc) -c -I$(inc) $(cflags) clink = $(cc) cpp = g++ cppcomp = $(cpp) -c -I$(inc) $(cppflags) cpplink = $(cpp) for = f77 fcomp = $(for) -c -I$(inc) $(fflags) flink = $(for) lexflags = lex = lex $(lexflags) yaccflags = yacc = yacc $(yaccflags) mkdir = mkdir comp = $(ccomp) link = $(cc) ar = ar -crl ranlib = ranlib tag = $(CMTCONFIG) tags = $(CMTEXTRATAGS) src = ../src/ inc = ../src/ mgr = ../mgr/ cmt = ../cmt/ bin = ../$(tag)/ build_strategy = rebuild_makefiles build_dependencies = echo #--------------------------------------------- # Controlling the verbosity of Make # ifdef QUIET LEX_QUIET = 1 YACC_QUIET = 1 C_QUIET = 1 CPP_QUIET = 1 FORTRAN_QUIET = 1 JAVA_QUIET = 1 LINK_QUIET = 1 LIB_QUIET = 1 CLEANUP_QUIET = 1 silent = @ echo = @/bin/echo else silent = echo = @- echo endif ifdef LEX_QUIET lex_silent = @ lex_echo = @/bin/echo rebuilding else lex_silent = lex_echo = $(echo) endif ifdef YACC_QUIET yacc_silent = @ yacc_echo = @/bin/echo rebuilding else yacc_silent = yacc_echo = $(echo) endif ifdef C_QUIET c_silent = @ c_echo = @/bin/echo rebuilding else c_silent = c_echo = $(echo) endif ifdef CPP_QUIET cpp_silent = @ cpp_echo = @/bin/echo rebuilding else cpp_silent = cpp_echo = $(echo) endif ifdef FORTRAN_QUIET fortran_silent = @ fortran_echo = @/bin/echo rebuilding else fortran_silent = fortran_echo = $(echo) endif ifdef JAVA_QUIET java_silent = @ java_echo = @/bin/echo rebuilding else java_silent = java_echo = $(echo) endif ifdef LINK_QUIET link_silent = @ link_echo = @/bin/echo rebuilding else link_silent = link_echo = $(echo) endif ifdef LIB_QUIET lib_silent = @ lib_echo = @/bin/echo rebuilding else lib_silent = lib_echo = $(echo) endif ifdef CLEANUP_QUIET cleanup_silent = @ cleanup_echo = @/bin/echo removing else cleanup_silent = cleanup_echo = $(echo) endif cmtexe = $(CMTROOT)/$(CMTBIN)/cmt.exe SHELL = /bin/sh all :: setup.make checkuses ## @if [ ! "`${CMTROOT}/mgr/cmt show uses | grep 'found'`" = "" ] ; then \ checkuses : @if test "$(build_strategy)" = "rebuild_makefiles"; then \ echo "Checking configuration"; \ a=`${CMTROOT}/mgr/cmt show strategies | grep keep_makefiles`; \ if test "$${a}" = ""; then \ /bin/rm -f constituents.make setup.make $(tag).make; \ fi; \ $(cmtexe) check configuration -tag=$(tags); \ touch checkuses; \ fi dirs :: checkuses @if test ! -r requirements ; then echo "No requirements file" ; fi; \ if test ! -d $(bin) ; then $(mkdir) -p $(bin) ; fi; \ /bin/rm -f checkuses javadirs :: @if test ! -d $(javabin) ; then $(mkdir) -p $(javabin) ; fi srcdirs :: @if test ! -d $(src) ; then $(mkdir) -p $(src) ; fi cmt_path.make :: checkuses @if test ! -f cmt_path.make -o "$(build_strategy)" = "rebuild_makefiles"; then \ echo "Rebuilding $@"; \ a=`$(cmtexe) show path -tag=$(tags) -quiet`; \ b=`$(cmtexe) show tags -tag=$(tags) -quiet`; \ /bin/rm -f cmt_path.make; \ echo '#'$${a} >cmt_path.make; \ echo '#'$${b} >>cmt_path.make; \ fi ### $(cmtexe) check_files cmt_path.make.tmp cmt_path.make; -include cmt_path.make setup.make : cmt_path.make requirements # $(CMTROOT)/mgr/cmt @if test ! -f setup.make -o "$(build_strategy)" = "rebuild_makefiles"; then \ echo "Rebuilding $@"; \ $(cmtexe) build make_setup -quiet -tag=$(tags) ; \ fi -include setup.make $(gmake_hosts) :: rsh $@ "sh -c '(cd `$(cmtexe) show pwd -quiet`; . setup.sh; gmake $(MAKEFLAGS) $(target))'" $(make_hosts) :: rsh $@ "sh -c '(cd `$(cmtexe) show pwd`; . setup.sh; make $(MAKEFLAGS) $(target))'" everywhere :: $(everywhere) clean :: checkuses ## @echo clean done check :: @echo check done help :: dirs setup.make @echo '--------------------------------------------------------------------------' @echo 'You may select one of the following make targets :' @echo ' ' @echo 'help : this help' @echo 'all : rebuild everything according to the $$(constituents) macro' @echo ' (this is the default target)' @echo 'clean : remove everything that can be rebuilt' @echo 'makefilesclean : remove configuration files (*.make)' @echo ' ' @groups=`$(cmtexe) show groups -tag=$(tags)`; \ echo "all $${groups} : " @echo ' rebuild all constituents of one of these groups' @echo ' ' @all=""; \ for c in `$(cmtexe) show constituent_names -tag=$(tags)` ; do \ if test ! "$${all}" = ""; then all="$${all} "; fi; \ all="$${all}$${c}" ; \ done; \ echo "$${all} : " @echo ' rebuild one of these constituents' @echo ' ' @echo 'check :' @echo ' run all applications defined with the -check option' @echo ' ' @echo 'everywhere [target=...] : ' @echo ' o Rebuild on all plateforms specified in the $$(everywhere) macro' @echo ' o Use "cmt show macro everywhere -tag=" to check it' @echo ' o The "target" option permits to transmit a target to the remote site' always :: .DEFAULT :: @echo "No action for $@"