Skip to content
This repository
Browse code

Added dynamic configuration

  • Loading branch information...
commit 53f875dd91ca710d4fc3b9f084615dde7742a7df 1 parent 249b259
Serge Aleynikov authored October 01, 2012
5  .gitignore
... ...
@@ -0,0 +1,5 @@
  1
+*.beam
  2
+*.o
  3
+*.swp
  4
+/priv
  5
+/ebin
6  Makefile
@@ -19,13 +19,13 @@ clean-docs:
19 19
 
20 20
 github-docs:
21 21
 	git checkout gh-pages
22  
-	git checkout master src include c_src Makefile
  22
+	git checkout master src include c_src Makefile vsn.mk rebar.*
23 23
 	make docs
24 24
 	make clean
25  
-	rm -fr ebin src include c_src Makefile
  25
+	rm -fr ebin src include c_src Makefile priv erl_crash.dump vsn.mk rebar.*
26 26
 	mv doc/* .
27 27
 	rmdir doc
28 28
 	sh -c "ret=0; set +e; \
29  
-		if git commit -a; then git push origin; else ret=1; git reset --hard; fi; \
  29
+		if git commit -a; then git push origin; else ret=1; exit $$ret; git reset --hard; fi; \
30 30
 		set -e; git checkout master; exit $$ret"
31 31
 
6  rebar.config
@@ -3,10 +3,4 @@
3 3
 	warn_export_all
4 4
 ]}.
5 5
 
6  
-{port_env, [{"CC",  "g++"},
7  
-            {"CXX", "g++"},
8  
-            {"linux", "LDFLAGS", "$LDFLAGS -lcap"}]}.
9  
-
10  
-{port_specs, [{"priv/exec-port", ["c_src/*.cpp"]}]}.
11  
-
12 6
 {pre_hooks, [{clean, "rm -fr ebin priv erl_crash.dump"}]}.
13  rebar.config.script
... ...
@@ -0,0 +1,13 @@
  1
+Arch = erlang:system_info(system_architecture),
  2
+{ok, <<"VSN=", I/binary>>} = file:read_file("vsn.mk"),
  3
+Vsn  = binary_to_list(binary:replace(I, <<"\n">>, <<"">>)),
  4
+[
  5
+    {port_env, [{"CC",  "g++"},
  6
+                {"CXX", "g++"},
  7
+                {"linux", "LDFLAGS", "$LDFLAGS -lcap"}]},
  8
+
  9
+    {port_specs, [{filename:join(["priv", Arch, "exec-port"]), ["c_src/*.cpp"]}]},
  10
+    {edoc_opts, [{overview, "src/overview.edoc"}, {title, "The exec application"},
  11
+                 {includes, ["include"]}, {def, {vsn, Vsn}}]}
  12
+].
  13
+
3  src/exec.erl
@@ -236,8 +236,7 @@ default() ->
236 236
 default(portexe) -> 
237 237
     % Get architecture (e.g. i386-linux)
238 238
     Dir = filename:dirname(filename:dirname(code:which(?MODULE))),
239  
-    %filename:join([Dir, "priv", ?system_architecture, "bin", "exec-port"]);
240  
-    filename:join([Dir, "priv", "exec-port"]);
  239
+    filename:join([Dir, "priv", ?system_architecture, "exec-port"]);
241 240
 default(Option) ->
242 241
     proplists:get_value(Option, default()).
243 242
 
1  vsn.mk
... ...
@@ -0,0 +1 @@
  1
+VSN=0.1

0 notes on commit 53f875d

Please sign in to comment.
Something went wrong with that request. Please try again.