Permalink
Browse files

Merge pull request #15 from bernardd/master

Fix makefile to work with multiple jobs
  • Loading branch information...
2 parents fb1f033 + e8d2d9c commit 2bcba56069721afc7d8c58f84ce701958ec7a761 @richcarl richcarl committed on GitHub Jan 23, 2017
Showing with 17 additions and 11 deletions.
  1. +16 −10 src/gettext_server.erl
  2. +1 −1 test/Makefile
View
@@ -89,24 +89,30 @@ gettext_def_lang() ->
%% Description: Starts the server
%%--------------------------------------------------------------------
start_link() ->
- start_link(?MODULE).
+ start_link({?MODULE, application:get_all_env()}, ?SERVER).
-start_link(CallBackMod) ->
- start_link(CallBackMod, ?SERVER).
+start_link(CallBackMod) when is_atom(CallBackMod) ->
+ start_link({CallBackMod, application:get_all_env()}, ?SERVER);
-start_link(CallBackMod, Name) ->
- gen_server:start_link({local, Name}, ?MODULE, [CallBackMod, Name],[]).
+start_link(Config) when is_list(Config) ->
+ start_link({?MODULE, Config}, ?SERVER).
+
+start_link({CallBackMod, Config}, Name) ->
+ gen_server:start_link({local, Name}, ?MODULE, [{CallBackMod, Config}, Name], []).
%%--------------------------------------------------------------------
start() ->
- start({?MODULE, application:get_all_env()}).
+ start({?MODULE, application:get_all_env()}, ?SERVER).
+
+start(CallBackMod) when is_atom(CallBackMod) ->
+ start({CallBackMod, application:get_all_env()}, ?SERVER);
-start(CallBackMod) ->
- start(CallBackMod, ?SERVER).
+start(Config) when is_list(Config) ->
+ start({?MODULE, Config}, ?SERVER).
-start(CallBackMod, Name) ->
- gen_server:start({local, Name}, ?MODULE, [CallBackMod, Name], []).
+start({CallBackMod, Config}, Name) ->
+ gen_server:start({local, Name}, ?MODULE, [{CallBackMod, Config}, Name], []).
%%====================================================================
%% Server functions
View
@@ -30,7 +30,7 @@ clean:
../ebin/%.beam: %.erl $(INCLUDES) Makefile
erlc -pa ../ebin -o ../ebin $(ERLC_FLAGS) +gettext $<
-test:
+test: $(EBIN_FILES) pot
@erl -pa ../ebin -noshell \
-eval 'gettext_demo:hello_world()' \
-s init stop

0 comments on commit 2bcba56

Please sign in to comment.