浏览代码

added build of static binary

Wolfgang Ortmann 9 年之前
父节点
当前提交
03e9c404ec
共有 3 个文件被更改,包括 8 次插入2 次删除
  1. 二进制
      bin/kind
  2. 7 1
      src/Makefile
  3. 1 1
      src/kind.cpp

二进制
bin/kind


+ 7 - 1
src/Makefile

@@ -3,7 +3,8 @@
 
 
 OBJECTS = kind.o filetools.o FileName.o DateTime.o stringtools.o KindConfig.o Lexer.o rulecomp.o
 OBJECTS = kind.o filetools.o FileName.o DateTime.o stringtools.o KindConfig.o Lexer.o rulecomp.o
 
 
-LOPT := $(OPT)
+LOPT := $(OPT) 
+#-static
 COPT := $(OPT) -std=c++11
 COPT := $(OPT) -std=c++11
 LIBS := 
 LIBS := 
 
 
@@ -33,6 +34,11 @@ ASTYLE_OPT = --style=gnu --unpad-paren --pad-header --pad-oper --indent-namespac
 kind: $(OBJECTS)
 kind: $(OBJECTS)
 	$(CXX) $(LOPT) $(LIBRARY) -o kind $(OBJECTS) $(LIBS)
 	$(CXX) $(LOPT) $(LIBRARY) -o kind $(OBJECTS) $(LIBS)
 
 
+static: kind
+	$(CXX) $(LOPT) $(LIBRARY) -static -o kind_static $(OBJECTS) $(LIBS)
+	strip kind_static
+	cp kind_static ../bin/kind
+
 clean:
 clean:
 	-rm -f *.o depend *~ *orig
 	-rm -f *.o depend *~ *orig
 
 

+ 1 - 1
src/kind.cpp

@@ -169,7 +169,7 @@ void readMasterConfig(const string& fn, KindConfig& conf)
 # 81 "kind.ag"
 # 81 "kind.ag"
   else if (fileExists("/etc/kind/master.conf"))
   else if (fileExists("/etc/kind/master.conf"))
 # 82 "kind.ag"
 # 82 "kind.ag"
-    readMasterConfig1("etc/kind/master.conf", conf);
+    readMasterConfig1("/etc/kind/master.conf", conf);
 # 83 "kind.ag"
 # 83 "kind.ag"
   else if (fileExists("/ffp/etc/kind/master.conf"))
   else if (fileExists("/ffp/etc/kind/master.conf"))
 # 84 "kind.ag"
 # 84 "kind.ag"