diff options
author | Bernard Normier <bernard@zeroc.com> | 2015-02-04 17:52:58 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2015-02-04 17:52:58 -0500 |
commit | 24b57dd4dd930534d1093e893bb013e0f1dfa0a2 (patch) | |
tree | 580578654de0de4c6ab2108af99bc9e824a85654 | |
parent | Service testing simplifications (diff) | |
download | ice-24b57dd4dd930534d1093e893bb013e0f1dfa0a2.tar.bz2 ice-24b57dd4dd930534d1093e893bb013e0f1dfa0a2.tar.xz ice-24b57dd4dd930534d1093e893bb013e0f1dfa0a2.zip |
Removed bison/flex fixes from makedist
-rw-r--r-- | distribution/lib/DistUtils.py | 84 | ||||
-rwxr-xr-x | distribution/makedist.py | 5 | ||||
-rw-r--r-- | distribution/src/common/Make.rules | 9 |
3 files changed, 9 insertions, 89 deletions
diff --git a/distribution/lib/DistUtils.py b/distribution/lib/DistUtils.py index fcf961a1611..1b99277e0ce 100644 --- a/distribution/lib/DistUtils.py +++ b/distribution/lib/DistUtils.py @@ -187,61 +187,6 @@ def copyMatchingFiles(srcpath, destpath, patterns, warnDestExists = True, verbos for p in patterns: for f in glob.glob(os.path.join(srcpath, p)): copy(f, os.path.join(destpath, os.path.basename(f)), warnDestExists) - -# -# Comment out rules in a Makefile. -# -def fixMakefileForFile(path): - (dir,file) = os.path.split(path) - (base,ext) = os.path.splitext(file) - # File the makefile file from the same directory as the file. - for f in glob.glob(os.path.join(dir, "Makefile*")): - fixMakefile(f, base, ext) - -# -# Comment out rules in a Makefile. -# -def fixMakefile(file, base, ext): - - origfile = file + ".orig" - os.rename(file, origfile) - oldMakefile = open(origfile, "r") - newMakefile = open(file, "w") - origLines = oldMakefile.readlines() - - doComment = 0 - doCheck = 0 - newLines = [] - for x in origLines: - # - # If the rule contains the target string, then - # comment out this rule. - # - if not x.startswith("\t") and x.find(base + ext) != -1: - doComment = 1 - # - # If the line starts with "clean::", then check - # the following lines and comment out any that - # contain the target string. - # - elif x.startswith("clean::"): - doCheck = 1 - # - # Stop when we encounter an empty line. - # - elif len(x.strip()) == 0: - doComment = 0 - doCheck = 0 - - if doComment or (doCheck and x.find(base) != -1): - x = "#" + x - newLines.append(x) - - newMakefile.writelines(newLines) - newMakefile.close() - oldMakefile.close() - os.remove(origfile) - # # Comment out rules in VC project. # @@ -287,35 +232,6 @@ def fixProject(file, target): oldProject.close() os.remove(origfile) -# -# Comment out implicit parser/scanner rules in config/Make.rules. -# -def fixMakeRules(file): - origfile = file + ".orig" - os.rename(file, origfile) - oldFile = open(origfile, "r") - newFile = open(file, "w") - origLines = oldFile.readlines() - - doComment = 0 - newLines = [] - for x in origLines: - if x.find("%.y") != -1 or x.find("%.l") != -1: - doComment = 1 - # - # Stop when we encounter an empty line. - # - elif len(x.strip()) == 0: - doComment = 0 - - if doComment: - x = "#" + x - newLines.append(x) - - newFile.writelines(newLines) - newFile.close() - oldFile.close() - os.remove(origfile) # # Fix version in given file. diff --git a/distribution/makedist.py b/distribution/makedist.py index 055a0b08d08..0fab5fff7ca 100755 --- a/distribution/makedist.py +++ b/distribution/makedist.py @@ -279,9 +279,6 @@ def createSourceDist(platform, destDir): fixVersion(os.path.join("vsaddin", "config", "Ice-VS2013.AddIn"), *versions) fixVersion(os.path.join("vsaddin", "config", "Ice.props"), *versions) - if os.path.exists(os.path.join("cpp", "config", "Make.rules")): - fixMakeRules(os.path.join("cpp", "config", "Make.rules")) - for root, dirnames, filenames in os.walk('.'): for f in filenames: filepath = os.path.join(root, f) @@ -290,8 +287,6 @@ def createSourceDist(platform, destDir): continue elif fnmatch.fnmatch(f, "README*") or fnmatch.fnmatch(f, "*.Addin"): fixVersion(filepath, *versions) - elif fnmatch.fnmatch(f, "*.y") or fnmatch.fnmatch(f, "*.l"): - fixMakefileForFile(filepath) elif f == "Grammar.cpp": checkBisonVersion(filepath) elif f == "Scanner.cpp": diff --git a/distribution/src/common/Make.rules b/distribution/src/common/Make.rules index ea0f645910b..be2966a0c24 100644 --- a/distribution/src/common/Make.rules +++ b/distribution/src/common/Make.rules @@ -63,6 +63,11 @@ embedded_runpath ?= yes # ---------------------------------------------------------------------- # +# Compile scanner and grammar files? +# +#BISON_FLEX ?= yes + +# # Common definitions # ice_language = cpp @@ -132,6 +137,8 @@ EVERYTHING_EXCEPT_ALL = clean rm -f $(*F).h $(*F).cpp $(SLICE2CPP) $(SLICE2CPPFLAGS) $(*F).ice +ifeq ($(BISON_FLEX),yes) + %.h %.cpp: %.y rm -f $(*F).h $(*F).cpp bison $(BISONFLAGS) $< @@ -146,6 +153,8 @@ EVERYTHING_EXCEPT_ALL = clean cat lex.yy.c >> $@ rm -f lex.yy.c +endif + all:: $(SRCS) $(TARGETS) clean:: |