dnl (c)INRIA 1999 Christophe.Lavarenne@inria.fr dnl $Id: U.m4m,v 1.1 2000/04/17 13:02:41 lavarenn Exp $ divert(-1) # SynDEx v5 Makefile generator for Unix multi-workstation ifdef(`syndex.m4m_already_included',,`errprint( __file__:__line__: m4: syndex.m4m must be included before __file__! )m4exit(1)') # ------------------------------------------------------------------------ # When this file is loaded, by the processor_ macro defined in syndex.m4m, # the macro appli_() expands to the name of the application, # the macro procr_() expands to the name of a processor of type U (Unix), # the macro gateTypes_() expands to the list of .m4x files. # The root processor, which execute make, and procr_ may have different # $HOSTTYPE (i386, sparc, alpha...) and/or $OSTYPE (Linux, SunOS, OSF...), # therefore root's native C compiler may not be used for procr_ C sources, # instead procr_'s native C compiler must be used remotely from root, and # the remote compiler input files must be first copied from root to procr_, # and the remote compiler output file must be then copied back to root, # available for the next remote compilation, or for final remote execution. # Remote compilation with file transfers is supported by $(M4PATH)/rshcd, # which considers as input files to transfer its non-option arguments from # its 3rd argument until the -o option, and as output files to transfer # the argument of the -o option (and its arguments after the -o option). # Moreover, files passed after "--" are extra inputs until any "-o" argument, # and extra outputs after "-o"; extra inputs and outputs are not passed to # , but are transfered. # -------------------- # procr_()_hostname_() # is expected to return procr_'s internet hostname; if not user-defined, # defaults to hostname for procr_=root, or to procr_ for other processors: ifdef(procr_`_hostname_',, `ifelse(procr_,`root', `dnl default to hostname: define(`root_hostname_', patsubst(esyscmd(`hostname'), ` '))dnl remove newline ending every `esyscmd' answer', `dnl default to self: define(procr_`_hostname_', procr_)')') divert`'dnl ------------------------------------------------------------ appli_.root += =procr_()_hostname_ procr_ : procr_.procr_.o $(procr_.libs)changequote({,}) S=`$(M4PATH)/rshcd procr_()_hostname_ "uname -sr"` ;\ case $$S in *SunOS*5.*) L='-lsocket -lnsl' ;; esac ;changequote\ $(M4PATH)/rshcd procr_()_hostname_ $(CC) $(CFLAGS) $^ $$L -lm -o $@ procr_.%.o : %.c $(M4PATH)/rshcd procr_()_hostname_ \ $(CC) $(CFLAGS) -c $< -o $@ -- $^ procr_.c : procr_.m4 syndex.m4x U.m4x C.m4x appli_.m4x gateTypes_ $(M4) $< >$@ clean :: test -x procr_()_hostname_.mnt && ./procr_()_hostname_.mnt ||\ $(M4PATH)/rshcd procr_()_hostname_ "\ $(RM) procr_ procr_.c procr_.procr_.o procr_()_hostname_.mnt" $(RM) procr_ procr_.c procr_.procr_.o procr_()_hostname_.mnt dnl -------------------------- end of file -----------------------------