Permalink
Browse files

Make fixes - now assumes R12B5 or greater.

  • Loading branch information...
1 parent 1a25922 commit 8dfaed6ca731d2d76b7617f3714438ff2cefd496 @archaelus committed with Vagabond Oct 14, 2009
Showing with 31 additions and 85 deletions.
  1. +6 −0 Emakefile
  2. +21 −67 Makefile
  3. +0 −14 Makefile.local
  4. +1 −1 include/errd_internal.hrl
  5. 0 {ebin → src}/errd.app
  6. +2 −2 src/errd_server.erl
  7. +1 −1 src/errdb.erl
View
@@ -0,0 +1,6 @@
+% -*- mode: erlang -*-
+{["src/*"],
+ [{i, "include"},
+ {outdir, "ebin"},
+ debug_info]
+}.
View
@@ -1,75 +1,29 @@
-APP_NAME=errd
-VSN=0.1
-APP_DEPS="sasl"
+VSN := 0.1
+ERL ?= erl
+EBIN_DIRS := $(wildcard lib/*/ebin)
+APP := errd
-include Makefile.local
+all: erl ebin/$(APP).app
-ERL_FILES ?=$(wildcard src/*.erl)
-HRL_FILES ?=$(wildcard include/*.hrl)
-BEAM_FILES ?=$(subst src/,ebin/,$(subst .erl,.beam,${ERL_FILES}))
-MODULES ?=$(subst src/,,$(subst .erl,,${ERL_FILES}))
-D_INC_DIRS=$(subst lib/, -I lib/,$(wildcard lib/*/include))
-D_EBIN_DIRS=$(subst lib/, -pa lib/,$(wildcard lib/*/ebin))
+erl: ebin lib
+ @$(ERL) -pa $(EBIN_DIRS) -pa ebin -noinput +B \
+ -eval 'case make:all() of up_to_date -> halt(0); error -> halt(1) end.'
-INCLUDE ?=-I ${ERLANG_ROOT}/lib/stdlib-*/include ${D_INC_DIRS}
-CODEPATH ?=-pz lib/*/ebin/
+docs:
+ @erl -noshell -run edoc_run application '$(APP)' '"."' '[]'
-ERLC_CODEPATH ?=${D_EBIN_DIRS} -pz ${EUNIT_ROOT}/ebin
-ERLC_FLAGS ?=+debug_info -W -o ebin/
+clean:
+ @echo "removing:"
+ @rm -fv ebin/*.beam ebin/*.app
-EXTRA_DIALYZER_BEAM_FILES ?=$(wildcard lib/oserl*/ebin/*.beam lib/common_lib*/ebin/*.beam lib/proc_reg*/ebin/*.beam)
+ebin/$(APP).app: src/$(APP).app
+ @cp -v src/$(APP).app $@
-NODE ?=-name ${APP_NAME}@127.0.0.1
+ebin:
+ @mkdir ebin
-all: ${BEAM_FILES} src/TAGS
+lib:
+ @mkdir lib
-release: ${BEAM_FILES} test xref dialyzer.report docs releases/${VSN}/${APP_NAME}.tar.gz
-
-.PHONY: info clean docs test xref shell dialyzer.report release shell_args shell_boot kannel kannel2 smppsim makelibs
-
-info:
- @echo Erlang root: +${ERLANG_ROOT}+
- @echo Eunit root: +${EUNIT_ROOT}+
- @echo Beam dirs: ${D_EBIN_DIRS}
- @echo Extra dialyzer beam files: ${EXTRA_DIALYZER_BEAM_FILES}
- @echo Include: +${INCLUDE}+
-
-clean:
- @rm -f ebin/*.beam priv/sasl/* priv/sasl.log priv/yaws/logs/*.{log,old,access}
- @find src/ priv/ -iname \*~ | xargs rm -v
-
-ebin/%.beam: src/%.erl ${HRL_FILES}
- @echo $@: erlc ${ERLC_FLAGS} ${ERLC_CODEPATH} ${INCLUDE} $<
- @erlc ${ERLC_FLAGS} ${ERLC_CODEPATH} ${INCLUDE} $<
-
-docs: ${ERL_FILES}
- erl -noshell -run edoc_run application "'$(APP_NAME)'" '"."' '[{def,{vsn,"$(VSN)"}}]'
- rm -rf priv/yaws/docroot/doc
- cp -r doc priv/yaws/docroot/
-
-test: ${BEAM_FILES}
- erl $(CODEPATH) -config priv/${APP_NAME} -eval "lists:map(fun(A) -> {A,application:start(A)} end, [${APP_DEPS}]), application:load(${APP_NAME}), lists:foreach(fun (M) -> io:fwrite(\"Testing ~p:~n\", [M]), eunit:test(M) end, [`perl -e 'print join(",", qw(${MODULES}));'`])." -s init stop -noshell
-
-xref: ${BEAM_FILES}
- erl $(CODEPATH) -eval "xref:start(${APP_NAME}), io:fwrite(\"~n~nXref: ~p~n~n\", [xref:d(\"ebin/\")])." -s init stop -noshell
-
-src/TAGS: ${BEAM_FILES}
- erl $(CODEPATH) -eval "tags:dir(\"src/\", [{outdir, \"src/\"}])." -s init stop -noshell
-
-shell_args:
- @(echo -ne "rr(\"include/*\").\nlists:map(fun(A) -> {A,application:start(A)} end, [${APP_DEPS}]).\napplication:start(${APP_NAME})." | pbcopy)
-
-shell: ${BEAM_FILES}
- erl +K true -smp +A 10 ${NODE} -config priv/${APP_NAME} $(CODEPATH)
-
-shell_boot: ${BEAM_FILES}
- erl ${NODE} -config priv/${APP_NAME} $(CODEPATH) -boot releases/${VSN}/${APP_NAME}
-
-dialyzer.report: ${BEAM_FILES}
- @(dialyzer --verbose --succ_typings ${INCLUDE} ${D_EBIN_DIRS} -c ${BEAM_FILES} ${EXTRA_DIALYZER_BEAM_FILES}; if [ $$? != 1 ]; then true; else false; fi)
-
-releases/${VSN}/${APP_NAME}.boot: ${BEAM_FILES} releases/${VSN}/${APP_NAME}.rel ebin/${APP_NAME}.app priv/${APP_NAME}.config
- erl $(CODEPATH) -eval 'systools:make_script("releases/${VSN}/${APP_NAME}").' -s init stop -noshell
-
-releases/${VSN}/${APP_NAME}.tar.gz: releases/${VSN}/${APP_NAME}.boot docs
- erl $(CODEPATH) -eval 'systools:make_tar("releases/${VSN}/${APP_NAME}", [{path, ["lib/*/ebin"]},{dirs,[include,src]}]).' -s init stop -noshell
+dialyzer: erl
+ @dialyzer -c ebin
View
@@ -1,14 +0,0 @@
-ifneq ($(wildcard /usr/lib/erlang),)
- ERLANG_ROOT=/usr/lib/erlang
-else
- ifneq ($(wildcard /Library/DarwinPorts/lib/erlang),)
- ERLANG_ROOT=/Library/DarwinPorts/lib/erlang
- endif
-endif
-ifneq ($(wildcard lib/eunit*),)
- EUNIT_ROOT=$(wildcard lib/eunit*)
-else
- ifneq ($(wildcard ../eunit),)
- EUNIT_ROOT=../eunit
- endif
-endif
@@ -1,5 +1,5 @@
--include_lib("eunit.hrl").
+-include_lib("eunit/include/eunit.hrl").
-include_lib("errd.hrl").
-define(INFO(Format, Args),
File renamed without changes.
View
@@ -11,8 +11,8 @@
%%--------------------------------------------------------------------
%% Include files
%%--------------------------------------------------------------------
--include("errd_internal.hrl").
--include("eunit.hrl").
+-include_lib("errd_internal.hrl").
+-include_lib("eunit/include/eunit.hrl").
%%--------------------------------------------------------------------
%% External exports
View
@@ -7,7 +7,7 @@
%%%-------------------------------------------------------------------
-module(errdb).
--include_lib("eunit.hrl").
+-include_lib("eunit/include/eunit.hrl").
%% API
-export([create/1,

0 comments on commit 8dfaed6

Please sign in to comment.