# # makefile in the subdirectory # # fluka definitions include $(FLUPRO)/makeflags # # defines SRCS = list of .f files include sources # # this is the rule for the " inferenced " dependence ( see last lines ) # : make a .o from a .f # the $< means take the input from targetlist.valid only in inference rules # inference rules target names start with a dot and have no slashes .f.o: # echo $(FTOP)/flutil/fff $($(EXTRA)) $< echo $< $(FTOP)/flutil/fff $($(EXTRA)) $< # LIB is the first target of the makefile. This branch is executed # if no other name # is given in the calling command line. # the value of LIB is defined in MAKEFLAGS ; in the makefile syntax # a line AAA=string defines the "MACRO" AAA # $LIB is then replaced by "string" ( i.e. $(FTOP)/libflukahp.a) # # The target LIB is updated if # it is older than its dependent(s) that is the name(s) following the # semicolon. If the dependant has in turn #dependencies, theese are # evaluated first, then the TABBED lines #below are executed. the $? means # the list of dependents that are newer than the target : in our case all # the .o files newer than libflukahp.a # !!!!! beware : on OSFMI some objs were mis-timed as older than lib!!! # /usr/sbin/sync forces buffered # files to be written on disk and their creation/modification date to be # updated : to avoid desincronization on very fast machines # a 1 second " sleep" time is added for safety $(LIB): $(SRCS:.f=.o) /bin/sync sleep 2 ar rv $(LIB) $? ranlib $(LIB) /bin/sync sleep 2 # here the rule to create the (SRCS:.f=.o) target before using it as a depen # dant for LIB # the definition (SRCS:.f=.o) is a "substitute sequence" way of defining # a macro : in evaluating the value of SRCS, all the occurrences of .f # are substituted by .o : this means in our case that the #"targets" to be updated ( or made if non-existant) are the object files. Their # dependent is a file named "update" in the include subdir that is created and #"touch"-ed every time a modified include module is detected, by the # splitadd script. # The rule itself is not given, it is implicitly # "inferred" as the .f.o rule ,since we are asking for a compiled file (.o) # and the system expects that some source will be compiled # ( this happens with a lot of canonical SUFFIXES ) $(SRCS:.f=.o): $(INC1)/update