Permalink
Browse files

updating build process

  • Loading branch information...
1 parent 06b1690 commit 8dbb958b1ed9cdf2e16f14504cc578060269deb2 Jacob Vorreuter committed Feb 25, 2010
Showing with 12 additions and 66 deletions.
  1. +7 −0 Emakefile
  2. +5 −10 Makefile
  3. +0 −9 src/Makefile
  4. +0 −47 support/include.mk
View
@@ -0,0 +1,7 @@
+% -*- mode: erlang -*-
+
+{['src/*'],
+ [{i, "include"},
+ {outdir, "ebin"},
+ debug_info]
+}.
View
@@ -2,24 +2,19 @@ LIBDIR=`erl -eval 'io:format("~s~n", [code:lib_dir()])' -s init stop -noshell`
VERSION=0.2
PKGNAME=erlmc
-all: app
- mkdir -p ebin/
- (cd src;$(MAKE))
+all: emake
+emake: app
+ erl -make
+
app:
sh ebin/$(PKGNAME).app.in $(VERSION)
test: all
prove t/*.t
clean:
- (cd src;$(MAKE) clean)
- rm -rf erl_crash.dump *.beam *.hrl ebin/*.app
-
-package: clean
- @mkdir $(PKGNAME)-$(VERSION)/ && cp -rf ebin include Makefile README.markdown src support t $(PKGNAME)-$(VERSION)
- @COPYFILE_DISABLE=true tar zcf $(PKGNAME)-$(VERSION).tgz $(PKGNAME)-$(VERSION)
- @rm -rf $(PKGNAME)-$(VERSION)/
+ rm -rf erl_crash.dump ebin/*.beam ebin/*.app
install:
mkdir -p $(prefix)/$(LIBDIR)/$(PKGNAME)-$(VERSION)/{ebin,include}
View
@@ -1,9 +0,0 @@
-include ../support/include.mk
-
-all: $(EBIN_FILES)
-
-debug:
- $(MAKE) DEBUG=-DDEBUG
-
-clean:
- rm -rf $(EBIN_FILES) erl_crash.dump
View
@@ -1,47 +0,0 @@
-## -*- makefile -*-
-
-ERL := erl
-ERLC := $(ERL)c
-
-INCLUDE_DIRS := ../include $(wildcard ../deps/*/include)
-EBIN_DIRS := $(wildcard ../deps/*/ebin)
-ERLC_FLAGS := -W $(INCLUDE_DIRS:../%=-I ../%) $(EBIN_DIRS:%=-pa %)
-
-ifndef no_debug_info
- ERLC_FLAGS += +debug_info
-endif
-
-ifdef debug
- ERLC_FLAGS += -Ddebug
-endif
-
-EBIN_DIR := ../ebin
-DOC_DIR := ../doc
-EMULATOR := beam
-
-ERL_TEMPLATE := $(wildcard *.et)
-ERL_SOURCES := $(wildcard *.erl)
-ERL_HEADERS := $(wildcard *.hrl) $(wildcard ../include/*.hrl)
-ERL_OBJECTS := $(ERL_SOURCES:%.erl=$(EBIN_DIR)/%.beam)
-ERL_TEMPLATES := $(ERL_TEMPLATE:%.et=$(EBIN_DIR)/%.beam)
-ERL_OBJECTS_LOCAL := $(ERL_SOURCES:%.erl=./%.$(EMULATOR))
-APP_FILES := $(wildcard *.app)
-EBIN_FILES = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app) $(ERL_TEMPLATES)
-MODULES = $(ERL_SOURCES:%.erl=%)
-
-../ebin/%.app: %.app
- cp $< $@
-
-$(EBIN_DIR)/%.$(EMULATOR): %.erl
- $(ERLC) $(ERLC_FLAGS) -o $(EBIN_DIR) $<
-
-$(EBIN_DIR)/%.$(EMULATOR): %.et
- $(ERL) -noshell -pa ../../elib/erltl/ebin/ -eval "erltl:compile(atom_to_list('$<'), [{outdir, \"../ebin\"}, report_errors, report_warnings, nowarn_unused_vars])." -s init stop
-
-./%.$(EMULATOR): %.erl
- $(ERLC) $(ERLC_FLAGS) -o . $<
-
-$(DOC_DIR)/%.html: %.erl
- $(ERL) -noshell -run edoc file $< -run init stop
- mv *.html $(DOC_DIR)
-

0 comments on commit 8dbb958

Please sign in to comment.