#!/home/nahaj/src/unixperl/rebuild # Directories I use. define SOURCE as /home/nahaj/src/unixperl/ define HERE as {THISDIRECTORY} define TOOLS as /home/nahaj/bin/ # tools I use define MAKEINCLUDE as {TOOLS}makeinclude define MAKEMOVE as {TOOLS}makemove define MYTOOLS as {MAKEINCLUDE} {MAKEMOVE} define COPY as /usr/bin/cp define DIFF as /usr/bin/diff define DELETE as /usr/bin/rm define SYSTOOLS as {COPY} {DIFF} # For tracking purposes, document what version of tools we are using. tools {MYTOOLS} {SYSTOOLS} # -------------------------------------- # Top level targets. # Dummy "all" all <= => echo "No All command in {THISDIRECTORY}" => echo "Availiable commands are:" => echo " commit or commit:filename" => echo " refresh or refresh:filename" => echo " clean" => echo "Done." clean <= {dir(.) | only(*.differences *.original) | * => clean:*} clean:* <= * => {DELETE} -f {*} ################################################################## # ------ COMMIT ------------------- # Put our working copies back into the source tree, documenting what # we changed. # The actual files we are working on. define COMMITINGFILES as { dir(.) | -f | minus (*.differences *.original) } # Special cases: # The source directory gets *.sourcedirectory files unpacked. define SOURCESPECIFIC as { {COMMITINGFILES} | *.sourcedirectory => {SOURCE}*} {SOURCESPECIFIC} <= {target}.sourcedirectory => {COPY} -p {target}.sourcedirectory {target} # We need to pack up test directory specific files also. define TESTSPECIFIC as { {COMMITINGFILES} | only(*.testdirectory) } {TESTSPECIFIC} <= {file} => {COPY} -p {file} {target} # An extra layer here so we can say: "commit:SPECIFICFILENAME" commit <= {{COMMITINGFILES} | * => commit:*} commit:* <= {SOURCE}* # Regular files. {SOURCE}Rebuild.* <= Rebuild.* => {COPY} -p {target} Rebuild.{*}.{DATESUFFIX}.original => {DIFF} Rebuild.{*}.{DATESUFFIX}.original Rebuild.{*} > Rebuild.{*}.{DATESUFFIX}.differences => {COPY} -p Rebuild.{*} {target} # Perl sources {SOURCE}* <= * => {MAKEMOVE} '{SOURCE}=>{HERE}' {target} {*}.{DATESUFFIX}.original => {DIFF} {*}.{DATESUFFIX}.original {*} > {*}.{DATESUFFIX}.differences => {MAKEMOVE} '{HERE}=>{SOURCE}' {*} {target} # ############################################################### # # ------------ REFRESH ------ # # ---- Grab fresh copies from Source tree. # (This section currently broken) # # # The actual files we are working on. # define REFRESHINGFILES as { dir({SOURCE}) | -f | minus (*.differences *.original) } # # # Special cases: # # # Unpack this directory's files. # define UNPACK as { {REFRESHINGFILES} | *.testdirectory => * } # {UNPACK} <= *.testdirectory # => {COPY} -p {*}.testdirectory {target} # # # Pack up source directory files. # define PACKUP as { {REFRESHINGFILES} | *.sourcedirectory => {SOURCE}*.sourcedirectory } # {PACKUP} <= {file} # => {COPY} -p {file} {target} # # refresh:* <= * # # An extra layer here so we can say: "refresh:SPECIFICFILENAME" # => {MAKEMOVE} '{SOURCE}=>{HERE}' {SOURCE}{*} {*}.{DATESUFFIX}.original # => {COPY} -p {SOURCE}{*} {*} # # # Refresh all # refresh <= { {REFRESHINGFILES} | * => refresh:*} #