dizzyd avatar dizzyd committed 2983353

Rebar-ized

Comments (0)

Files changed (7)

+ebin/.*.beam$
+
 all:
-	(cd src;$(MAKE) all)
+	./rebar compile
 
 edoc:
-	(cd src;$(MAKE) edoc)
+	erl -noshell -pa ebin \
+	    -eval "edoc:application(mochiweb), \".\", [{dir, \"doc\"}])" \
+	    -s init stop
 
 test:
-	(cd src;$(MAKE) test)
+	erl -noshell -pa ebin -s mochiweb test -s init stop
 
 clean:
-	(cd src;$(MAKE) clean)
+	./rebar clean

ebin/mochiweb.app

+{application, mochiweb,
+ [{description, "MochiMedia Web Server"},
+  {vsn, "0.01"},
+  {modules, [
+        mochihex,
+        mochijson,
+        mochijson2,
+        mochinum,
+        mochiweb,
+        mochiweb_app,
+        mochiweb_charref,
+        mochiweb_cookies,
+        mochiweb_echo,
+        mochiweb_headers,
+        mochiweb_html,
+        mochiweb_http,
+        mochiweb_multipart,
+        mochiweb_request,
+        mochiweb_response,
+        mochiweb_skel,
+        mochiweb_socket_server,
+        mochiweb_sup,
+        mochiweb_util,
+        reloader,
+        mochifmt,
+        mochifmt_std,
+        mochifmt_records
+	    ]},
+  {registered, []},
+  {mod, {mochiweb_app, []}},
+  {env, []},
+  {applications, [kernel, stdlib]}]}.

Binary file added.

src/Makefile

-include ../support/include.mk
-
-APPLICATION=mochiweb
-DOC_OPTS={dir,\"../doc\"}
-
-all: $(EBIN_FILES)
-
-debug:
-	$(MAKE) DEBUG=-DDEBUG
-
-clean:
-	rm -rf $(EBIN_FILES)
-
-edoc:
-	$(ERL) -noshell -pa ../ebin \
-		-eval "edoc:application($(APPLICATION), \".\", [$(DOC_OPTS)])" \
-		-s init stop
-
-test: all
-	$(ERL) -noshell -pa ../ebin -s $(APPLICATION) test -s init stop

src/mochiweb.app

-{application, mochiweb,
- [{description, "MochiMedia Web Server"},
-  {vsn, "0.01"},
-  {modules, [
-        mochihex,
-        mochijson,
-        mochijson2,
-        mochinum,
-        mochiweb,
-        mochiweb_app,
-        mochiweb_charref,
-        mochiweb_cookies,
-        mochiweb_echo,
-        mochiweb_headers,
-        mochiweb_html,
-        mochiweb_http,
-        mochiweb_multipart,
-        mochiweb_request,
-        mochiweb_response,
-        mochiweb_skel,
-        mochiweb_socket_server,
-        mochiweb_sup,
-        mochiweb_util,
-        reloader,
-        mochifmt,
-        mochifmt_std,
-        mochifmt_records
-	    ]},
-  {registered, []},
-  {mod, {mochiweb_app, []}},
-  {env, []},
-  {applications, [kernel, stdlib]}]}.

support/include.mk

-## -*- makefile -*-
-
-######################################################################
-## Erlang
-
-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
-EMULATOR := beam
-
-ERL_SOURCES := $(wildcard *.erl)
-ERL_HEADERS := $(wildcard *.hrl) $(wildcard ../include/*.hrl)
-ERL_OBJECTS := $(ERL_SOURCES:%.erl=$(EBIN_DIR)/%.$(EMULATOR))
-ERL_OBJECTS_LOCAL := $(ERL_SOURCES:%.erl=./%.$(EMULATOR))
-APP_FILES := $(wildcard *.app)
-EBIN_FILES = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app)
-MODULES = $(ERL_SOURCES:%.erl=%)
-
-../ebin/%.app: %.app
-	cp $< $@
-
-$(EBIN_DIR)/%.$(EMULATOR): %.erl
-	$(ERLC) $(ERLC_FLAGS) -o $(EBIN_DIR) $<
-
-./%.$(EMULATOR): %.erl
-	$(ERLC) $(ERLC_FLAGS) -o . $<
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.