Skip to content

Commit

Permalink
generate epgsql.app at compile time
Browse files Browse the repository at this point in the history
  • Loading branch information
wg committed Sep 26, 2010
1 parent 122028f commit 0cbf00e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,4 @@
*.beam *.beam
*.boot *.boot
*.script *.script
ebin/*.app
9 changes: 6 additions & 3 deletions Makefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RELEASE := $(NAME)-$(VERSION).tar.gz
APPDIR := $(NAME)-$(VERSION) APPDIR := $(NAME)-$(VERSION)
BEAMS := $(SRC:src/%.erl=ebin/%.beam) BEAMS := $(SRC:src/%.erl=ebin/%.beam)


compile: $(BEAMS) compile: $(BEAMS) ebin/$(NAME).app


app: compile app: compile
@mkdir -p $(APPDIR)/ebin @mkdir -p $(APPDIR)/ebin
Expand All @@ -26,11 +26,11 @@ release: app
@tar czvf $(RELEASE) $(APPDIR) @tar czvf $(RELEASE) $(APPDIR)


clean: clean:
@rm -f ebin/*.beam @rm -f ebin/*.{beam,app}
@rm -rf $(NAME)-$(VERSION) $(NAME)-*.tar.gz @rm -rf $(NAME)-$(VERSION) $(NAME)-*.tar.gz


test: $(TESTS:test_src/%.erl=test_ebin/%.beam) $(BEAMS) test: $(TESTS:test_src/%.erl=test_ebin/%.beam) $(BEAMS)
@dialyzer --src -c src @dialyzer -n --src -c src
$(ERL) -pa ebin/ -pa test_ebin/ -noshell -s pgsql_tests run_tests -s init stop $(ERL) -pa ebin/ -pa test_ebin/ -noshell -s pgsql_tests run_tests -s init stop


# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
Expand All @@ -41,5 +41,8 @@ test: $(TESTS:test_src/%.erl=test_ebin/%.beam) $(BEAMS)
ebin/%.beam : src/%.erl ebin/%.beam : src/%.erl
$(ERLC) $(ERLC_FLAGS) -o $(dir $@) $< $(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<


ebin/%.app : src/%.app.src
sed -e s/VERSION/$(VERSION)/g $< > $@

test_ebin/%.beam : test_src/%.erl test_ebin/%.beam : test_src/%.erl
$(ERLC) $(ERLC_FLAGS) -o $(dir $@) $< $(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<
Empty file added ebin/.empty
Empty file.
1 change: 0 additions & 1 deletion ebin/epgsql.app

This file was deleted.

2 changes: 1 addition & 1 deletion src/epgsql.app → src/epgsql.app.src
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, epgsql, {application, epgsql,
[{description, "PostgreSQL Client"}, [{description, "PostgreSQL Client"},
{vsn, "1.2"}, {vsn, "VERSION"},
{modules, [pgsql, pgsql_binary, pgsql_connection, pgsql_fdatetime, {modules, [pgsql, pgsql_binary, pgsql_connection, pgsql_fdatetime,
pgsql_idatetime, pgsql_sock, pgsql_types]}, pgsql_idatetime, pgsql_sock, pgsql_types]},
{registered, []}, {registered, []},
Expand Down

0 comments on commit 0cbf00e

Please sign in to comment.