diff --git a/Makefile b/Makefile index b6a120e..df10ce5 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,13 @@ LIBDIR=`erl -eval 'io:format("~s~n", [code:lib_dir()])' -s init stop -noshell` VERSION=0.3.0 PKGNAME=erlang_protobuffs -all: +all: app mkdir -p ebin/ (cd src;$(MAKE)) +app: + sh ebin/$(PKGNAME).app.in $(VERSION) + test: all prove t/*.t @@ -15,7 +18,7 @@ test-eqc: all clean: (cd src;$(MAKE) clean) (cd t; $(MAKE) clean) - rm -rf erl_crash.dump *.beam *.hrl + rm -rf erl_crash.dump *.beam *.hrl ebin/*.app package: clean @mkdir $(PKGNAME)-$(VERSION)/ && cp -rf ebin Makefile README.markdown scripts src support t $(PKGNAME)-$(VERSION) diff --git a/ebin/erlang_protobuffs.app b/ebin/erlang_protobuffs.app deleted file mode 100644 index 9b1a2a2..0000000 --- a/ebin/erlang_protobuffs.app +++ /dev/null @@ -1,32 +0,0 @@ -%%% -*- mode:erlang -*- -{application, erlang_protobuffs, - [ - % A quick description of the application. - {description, "Google protobuffs implementation for Erlang."}, - - % The version of the applicaton - {vsn, "0.3.0"}, - - % All modules used by the application. - {modules, - [ - pokemon_pb, - protobuffs, - protobuffs_compile, - protobuffs_parser - ]}, - - - % A list of the registered processes in your application. Used to prevent collisions. - {registered, []}, - - % This is a list of the applications that your application depends on. This list must be filled out - % carefully so that dependency resolution systems can function properly. - {applications, [kernel, stdlib]}, - - % configuration parameters similar to those in the config file specified - % on the command line. can be fetched with gas:get_env - {env, []} - ] -}. - diff --git a/ebin/erlang_protobuffs.app.in b/ebin/erlang_protobuffs.app.in new file mode 100644 index 0000000..7eee717 --- /dev/null +++ b/ebin/erlang_protobuffs.app.in @@ -0,0 +1,16 @@ +#!/bin/bash + +VERSION=${1} +MODULES=`ls -1 src/*.erl | awk -F[/.] '{ print "\t\t" $2 }' | sed '$q;s/$/,/g'` + +cat > ebin/erlang_protobuffs.app << EOF +{application, erlang_protobuffs, [ + {description, "Google protobuffs implementation for Erlang."}, + {vsn, "${VERSION}"}, + {modules, [ +${MODULES} + ]}, + {registered, []}, + {applications, [kernel, stdlib, sasl, crypto, log_roller, stateless_server]} +]}. +EOF