Browse Source

Use rebar as build tool

* Add rebar
* Move build flags from src/Makefile to rebar.config
* Remove src/Makefile
* Put version in src/ibrowse.app.src
* Remove vsn.mk
* Remove ebin/ibrowse.app
* Change Makefile to read version from src/ibrowse.app.src
* Change Makefile all target to call ./rebar compile
* Change Makefile clean target to call ./rebar clean
* Update .gitignore to ignore ebin/*
pull/31/head
Andrew Tunnell-Jones 14 years ago
parent
commit
8c12491c68
8 changed files with 6 additions and 52 deletions
  1. +1
    -1
      .gitignore
  2. +3
    -3
      Makefile
  3. +0
    -13
      ebin/ibrowse.app
  4. BIN
      rebar
  5. +1
    -0
      rebar.config
  6. +0
    -32
      src/Makefile
  7. +1
    -1
      src/ibrowse.app.src
  8. +0
    -2
      vsn.mk

+ 1
- 1
.gitignore View File

@ -1,2 +1,2 @@
*.beam
ebin/*

+ 3
- 3
Makefile View File

@ -1,10 +1,10 @@
include vsn.mk
IBROWSE_VSN = $(shell sed -n 's/.*{vsn,.*"\(.*\)"}.*/\1/p' src/ibrowse.app.src)
all: all:
(cd src ; make)
./rebar compile
clean: clean:
(cd src ; make clean)
./rebar clean
install: all install: all
mkdir -p $(DESTDIR)/lib/ibrowse-$(IBROWSE_VSN)/ mkdir -p $(DESTDIR)/lib/ibrowse-$(IBROWSE_VSN)/

+ 0
- 13
ebin/ibrowse.app View File

@ -1,13 +0,0 @@
{application, ibrowse,
[{description, "HTTP client application"},
{vsn, "2.1.2"},
{modules, [ ibrowse,
ibrowse_http_client,
ibrowse_app,
ibrowse_sup,
ibrowse_lib,
ibrowse_lb ]},
{registered, []},
{applications, [kernel,stdlib,sasl]},
{env, []},
{mod, {ibrowse_app, []}}]}.

BIN
rebar View File


+ 1
- 0
rebar.config View File

@ -0,0 +1 @@
{erl_opts, [warn_unused_vars, nowarn_shadow_vars, warn_unused_import]}.

+ 0
- 32
src/Makefile View File

@ -1,32 +0,0 @@
include ../vsn.mk
ERL_FILES = ibrowse.erl \
ibrowse_http_client.erl \
ibrowse_app.erl \
ibrowse_sup.erl \
ibrowse_lib.erl \
ibrowse_lb.erl \
ibrowse_test.erl
INCLUDE_DIRS = -I./
ERLC ?= erlc
ERLC_EMULATOR ?= erl -boot start_clean
COMPILER_OPTIONS = -W +warn_unused_vars +nowarn_shadow_vars +warn_unused_import
.SUFFIXES: .erl .beam $(SUFFIXES)
EBIN = ../ebin
all: $(ERL_FILES:%.erl=$(EBIN)/%.beam) ../ebin/ibrowse.app
$(EBIN)/%.beam: %.erl
${ERLC} $(COMPILER_OPTIONS) $(INCLUDE_DIRS) -o ../ebin $<
$(EBIN)/%.app: %.app.src ../vsn.mk Makefile
sed -e s/%IBROWSE_VSN%/$(IBROWSE_VSN)/ \
$< > $@
clean:
rm -f $(EBIN)/*.beam $(EBIN)/*.app

+ 1
- 1
src/ibrowse.app.src View File

@ -1,6 +1,6 @@
{application, ibrowse, {application, ibrowse,
[{description, "HTTP client application"}, [{description, "HTTP client application"},
{vsn, "%IBROWSE_VSN%"},
{vsn, "2.1.2"},
{modules, [ ibrowse, {modules, [ ibrowse,
ibrowse_http_client, ibrowse_http_client,
ibrowse_app, ibrowse_app,

+ 0
- 2
vsn.mk View File

@ -1,2 +0,0 @@
IBROWSE_VSN = 2.1.2

Loading…
Cancel
Save