diff options
Diffstat (limited to 'cpp')
-rwxr-xr-x | cpp/iceslmakedist.py | 155 |
1 files changed, 81 insertions, 74 deletions
diff --git a/cpp/iceslmakedist.py b/cpp/iceslmakedist.py index 0db76215cf8..b04ba431ef5 100755 --- a/cpp/iceslmakedist.py +++ b/cpp/iceslmakedist.py @@ -170,6 +170,8 @@ if os.path.exists(distdir): shutil.rmtree(distdir) os.mkdir(distdir) os.mkdir(os.path.join(distdir, "icesl")) +tmpdir = "tmp" +os.mkdir(os.path.join(distdir, tmpdir)) # # Export sources from git. @@ -181,22 +183,84 @@ else: quiet = "" os.system("git archive " + quiet + " " + tag + " . | (cd dist/icesl && tar xf -)") -os.chdir(distdir) +os.chdir(os.path.join("..", "sl", "src")) +os.system("git archive " + quiet + " " + tag + " . | (cd ../../cpp/dist/tmp && tar xf -)") + +os.chdir(os.path.join("..", "..", "distribution", "src", "icesl")) +os.system("git archive " + quiet + " " + tag + " . | (cd ../../../cpp/dist/tmp && tar xf -)") + +os.chdir(os.path.join("..", "..", "..", "cpp", distdir)) # -# Copy Ice-E specific install files. +# Copy IceSL specific install files. # -#print "Copying icesl install files..." -#shutil.copyfile(os.path.join("ice", "install", "icee", "ICE_LICENSE"), os.path.join("ice", "ICE_LICENSE")) -#shutil.copyfile(os.path.join("ice", "install", "icee", "README"), os.path.join("ice", "README")) -#shutil.copyfile(os.path.join("ice", "install", "icee", "INSTALL.LINUX"), os.path.join("ice", "INSTALL.LINUX")) -#shutil.copyfile(os.path.join("ice", "install", "icee", "INSTALL.WINDOWS"), os.path.join("ice", "INSTALL.WINDOWS")) +print "Copying icesl install files..." +shutil.copyfile(os.path.join("tmp", "ICE_LICENSE"), os.path.join("icesl", "ICE_LICENSE")) +shutil.copyfile(os.path.join("tmp", "README"), os.path.join("icesl", "README")) +shutil.copyfile(os.path.join("tmp", "INSTALL"), os.path.join("icesl", "INSTALL")) # -# Move Make.rules*icee +# Move Make.rules.mak.icesl # -shutil.move(os.path.join("icesl", "config", "Make.rules.icee"), os.path.join("icesl", "config", "Make.rules")) -shutil.move(os.path.join("icesl", "config", "Make.rules.mak.icee"), os.path.join("icesl", "config", "Make.rules.mak")) +shutil.move(os.path.join("icesl", "config", "Make.rules.mak.icesl"), os.path.join("icesl", "config", "Make.rules.mak")) + +# +# Generate bison files. +# +print "Generating bison files..." +cwd = os.getcwd() +grammars = find("icesl", "*.y") +for x in grammars: + # + # Change to the directory containing the file. + # + (dir,file) = os.path.split(x) + os.chdir(dir) + (base,ext) = os.path.splitext(file) + # + # Run gmake to create the output files. + # + if verbose: + quiet = "" + else: + quiet = "-s" + if file == "cexp.y": + os.system("gmake " + quiet + " cexp.c") + else: + os.system("gmake " + quiet + " " + base + ".cpp") + # + # Edit the Makefile to comment out the grammar rules. + # + fixMakefile("Makefile.mak", base) + + os.chdir(cwd) + +# +# Generate flex files. +# +print "Generating flex files..." +scanners = find("icesl", "*.l") +for x in scanners: + # + # Change to the directory containing the file. + # + (dir,file) = os.path.split(x) + os.chdir(dir) + (base,ext) = os.path.splitext(file) + # + # Run gmake to create the output files. + # + if verbose: + quiet = "" + else: + quiet = "-s" + os.system("gmake " + quiet + " " + base + ".cpp") + # + # Edit the Makefile to comment out the flex rules. + # + fixMakefile("Makefile.mak", base) + + os.chdir(cwd) # # Remove files. @@ -210,6 +274,7 @@ filesToRemove = [ \ os.path.join("icesl", "INSTALL.WINDOWS"), \ os.path.join("icesl", "INSTALL.LINUX"), \ os.path.join("icesl", "iceemakedist.py"), \ + os.path.join("icesl", "iceslmakedist.py"), \ os.path.join("icesl", "WINDOWS_SERVICE.txt"), \ os.path.join("icesl", "makedist.py"), \ os.path.join("icesl", "fixCopyright.py"), \ @@ -235,7 +300,10 @@ filesToRemove = [ \ os.path.join("icesl", "config", "Make.rules.Linux"), \ os.path.join("icesl", "config", "Make.rules.OSF1"), \ os.path.join("icesl", "config", "Make.rules.SunOS"), \ + os.path.join("icesl", "config", "Make.rules.icee"), \ + os.path.join("icesl", "config", "Make.rules.mak.icee"), \ os.path.join("icesl", "config", "PropertyNames.xml"), \ + os.path.join("icesl", "config", "templates.xml"), \ os.path.join("icesl", "config", "upgradeicegrid.py"), \ os.path.join("icesl", "config", "upgradeicestorm.py"), \ ] @@ -280,75 +348,13 @@ shutil.rmtree(os.path.join("icesl", "src", "slice2py")) shutil.rmtree(os.path.join("icesl", "src", "slice2rb")) # -# Generate bison files. -# -print "Generating bison files..." -cwd = os.getcwd() -grammars = find("icesl", "*.y") -for x in grammars: - # - # Change to the directory containing the file. - # - (dir,file) = os.path.split(x) - os.chdir(dir) - (base,ext) = os.path.splitext(file) - # - # Run gmake to create the output files. - # - if verbose: - quiet = "" - else: - quiet = "-s" - if file == "cexp.y": - os.system("gmake " + quiet + " cexp.c") - else: - os.system("gmake " + quiet + " " + base + ".cpp") - # - # Edit the Makefile to comment out the grammar rules. - # - fixMakefile("Makefile.mak", base) - - os.chdir(cwd) - -# -# Generate flex files. -# -print "Generating flex files..." -scanners = find("icesl", "*.l") -for x in scanners: - # - # Change to the directory containing the file. - # - (dir,file) = os.path.split(x) - os.chdir(dir) - (base,ext) = os.path.splitext(file) - # - # Run gmake to create the output files. - # - if verbose: - quiet = "" - else: - quiet = "-s" - os.system("gmake " + quiet + " " + base + ".cpp") - # - # Edit the Makefile to comment out the flex rules. - # - fixMakefile("Makefile.mak", base) - - os.chdir(cwd) - -# # Get IceSL version. # -#config = open(os.path.join("icee", "include", "IceE", "Config.h"), "r") -#version = re.search("ICEE_STRING_VERSION \"([0-9\.]*)\"", config.read()).group(1) - -version = "0.1.0" - +config = open(os.path.join("tmp", "Ice", "AssemblyInfo.cs"), "r") +version = re.search("AssemblyVersion.*\"([0-9\.]*)\".*", config.read()).group(1) print "Fixing makefiles..." - for makeRulesName in [os.path.join("icesl", "config", "Make.rules.mak")]: fixMakeRules(makeRulesName) makeRules = open(makeRulesName, "r") @@ -437,4 +443,5 @@ os.system("zip -9r" + quiet + " " + icever + ".zip " + icever) # print "Cleaning up..." shutil.rmtree(icever) +shutil.rmtree(tmpdir) print "Done." |