Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simplify build process

  • Loading branch information...
commit 9c979a2c79852702fe79000d53b580ce0e3516f1 1 parent 143496b
@etrepum etrepum authored
View
11 Makefile
@@ -1,13 +1,8 @@
-
-
all:
(cd src;$(MAKE))
+local:
+ (cd src;$(MAKE) local)
+
clean:
(cd src;$(MAKE) clean)
-
-release: clean appfile
- sh support/create_release.sh
-
-appfile:
- (cd src;$(MAKE) ../ebin/egeoip.app)
View
124 doc/egeoip.html
@@ -2,31 +2,33 @@
<html>
<head>
<title>Module egeoip</title>
-<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
+<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
+<hr>
<h1>Module egeoip</h1>
-Geolocation by IP address.
+<ul class="index"><li><a href="#description">Description</a></li><li><a href="#types">Data Types</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>Geolocation by IP address.
<p>Copyright © 2006 Bob Ippolito</p>
-<ul><li><a href="#description">Description</a></li><li><a href="#types">Data Types</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>
+
<p><b>Behaviours:</b> <a href="gen_server.html"><tt>gen_server</tt></a>.</p>
<p><b>Authors:</b> Bob Ippolito (<a href="mailto:bob@redivi.com"><tt>bob@redivi.com</tt></a>).</p>
<h2><a name="description">Description</a></h2>Geolocation by IP address.
<h2><a name="types">Data Types</a></h2>
-<h3><a name="type-geoip_atom">geoip_atom()</a></h3>
+<h3 class="typedecl"><a name="type-geoip_atom">geoip_atom()</a></h3>
<p><tt>geoip_atom() = country_code | country_code3 | country_name | region | city | postal_code | latitude | longitude | area_code | dma_code</tt></p>
-<h3><a name="type-geoip_field">geoip_field()</a></h3>
+<h3 class="typedecl"><a name="type-geoip_field">geoip_field()</a></h3>
<p><tt>geoip_field() = geoip_atom | [<a href="#type-geoip_atom">geoip_atom()</a>]</tt></p>
<h2><a name="index">Function Index</a></h2>
-<table width="100%" border="1"><tr><td valign="top"><a href="#bench-0">bench/0</a></td><td/></tr>
-<tr><td valign="top"><a href="#bench-1">bench/1</a></td><td/></tr>
+<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#bench-0">bench/0</a></td><td></td></tr>
+<tr><td valign="top"><a href="#bench-1">bench/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#code_change-3">code_change/3</a></td><td>gen_server callback.</td></tr>
<tr><td valign="top"><a href="#filename-0">filename/0</a></td><td>Get the database filename currently being used by the server.</td></tr>
<tr><td valign="top"><a href="#get-2">get/2</a></td><td>Get a field from the geoip record returned by lookup.</td></tr>
@@ -53,89 +55,113 @@
<h2><a name="functions">Function Details</a></h2>
-<h3><a name="bench-0">bench/0</a></h3>
-<tt>bench() -&gt; term()
-</tt>
+<h3 class="function"><a name="bench-0">bench/0</a></h3>
+<div class="spec">
+<p><tt>bench() -&gt; term()</tt></p>
+</div>
-<h3><a name="bench-1">bench/1</a></h3>
-<tt>bench(Count) -&gt; term()
-</tt>
+<h3 class="function"><a name="bench-1">bench/1</a></h3>
+<div class="spec">
+<p><tt>bench() -&gt; term()</tt></p>
+</div>
-<h3><a name="code_change-3">code_change/3</a></h3>
+<h3 class="function"><a name="code_change-3">code_change/3</a></h3>
+<div class="spec">
<p><tt>code_change(OldVsn, State, Extra) -&gt; NewState</tt></p>
-<p>gen_server callback.</p>
+</div><p>gen_server callback.</p>
-<h3><a name="filename-0">filename/0</a></h3>
+<h3 class="function"><a name="filename-0">filename/0</a></h3>
+<div class="spec">
<p><tt>filename() -&gt; string()</tt></p>
-<p>Get the database filename currently being used by the server.</p>
+</div><p>Get the database filename currently being used by the server.</p>
-<h3><a name="get-2">get/2</a></h3>
+<h3 class="function"><a name="get-2">get/2</a></h3>
+<div class="spec">
<p><tt>get(R::<a href="#type-geoip">geoip()</a>, Field::<a href="#type-geoip_field">geoip_field()</a>) -&gt; term()</tt></p>
-<p>Get a field from the geoip record returned by lookup.</p>
+</div><p>Get a field from the geoip record returned by lookup.</p>
-<h3><a name="handle_call-3">handle_call/3</a></h3>
+<h3 class="function"><a name="handle_call-3">handle_call/3</a></h3>
+<div class="spec">
<p><tt>handle_call(X1::Msg, From, State) -&gt; term()</tt></p>
-<p>gen_server callback.</p>
+</div><p>gen_server callback.</p>
-<h3><a name="handle_cast-2">handle_cast/2</a></h3>
+<h3 class="function"><a name="handle_cast-2">handle_cast/2</a></h3>
+<div class="spec">
<p><tt>handle_cast(X1::Msg, State) -&gt; term()</tt></p>
-<p>gen_server callback.</p>
+</div><p>gen_server callback.</p>
-<h3><a name="handle_info-2">handle_info/2</a></h3>
+<h3 class="function"><a name="handle_info-2">handle_info/2</a></h3>
+<div class="spec">
<p><tt>handle_info(Info, State) -&gt; {noreply, State}</tt></p>
-<p>gen_server callback.</p>
+</div><p>gen_server callback.</p>
-<h3><a name="init-1">init/1</a></h3>
+<h3 class="function"><a name="init-1">init/1</a></h3>
+<div class="spec">
<p><tt>init(FileName::Path) -&gt; {ok, State}</tt></p>
-<p>initialize the server with the database at Path.</p>
+</div><p>initialize the server with the database at Path.</p>
-<h3><a name="ip2long-1">ip2long/1</a></h3>
+<h3 class="function"><a name="ip2long-1">ip2long/1</a></h3>
+<div class="spec">
<p><tt>ip2long(Address) -&gt; {ok, integer()}</tt></p>
-<p>Convert an IP address from a string, IPv4 tuple or IPv6 tuple to the
+</div><p>Convert an IP address from a string, IPv4 tuple or IPv6 tuple to the
big endian integer representation.</p>
-<h3><a name="lookup-1">lookup/1</a></h3>
+<h3 class="function"><a name="lookup-1">lookup/1</a></h3>
+<div class="spec">
<p><tt>lookup(Address) -&gt; <a href="#type-geoip">geoip()</a></tt></p>
-<p>Get a geoip() record for the given address. Fields can be obtained
+</div><p>Get a geoip() record for the given address. Fields can be obtained
from the record using get/2.</p>
-<h3><a name="lookup-2">lookup/2</a></h3>
+<h3 class="function"><a name="lookup-2">lookup/2</a></h3>
+<div class="spec">
<p><tt>lookup(D::<a href="#type-geoipdb">geoipdb()</a>, Addr) -&gt; {ok, <a href="#type-geoip">geoip()</a>}</tt></p>
-<p>Lookup a geoip record for Addr using the database D.</p>
+</div><p>Lookup a geoip record for Addr using the database D.</p>
-<h3><a name="new-0">new/0</a></h3>
+<h3 class="function"><a name="new-0">new/0</a></h3>
+<div class="spec">
<p><tt>new() -&gt; {ok, <a href="#type-geoipdb">geoipdb()</a>}</tt></p>
-<p>Create a new geoipdb database record using the default
+</div><p>Create a new geoipdb database record using the default
priv/GeoLiteCity.dat.gz database.</p>
-<h3><a name="new-1">new/1</a></h3>
+<h3 class="function"><a name="new-1">new/1</a></h3>
+<div class="spec">
<p><tt>new(Path) -&gt; {ok, <a href="#type-geoipdb">geoipdb()</a>}</tt></p>
-<p>Create a new geoipdb database record using the database at Path.</p>
+</div><p>Create a new geoipdb database record using the database at Path.</p>
-<h3><a name="reload-0">reload/0</a></h3>
+<h3 class="function"><a name="reload-0">reload/0</a></h3>
+<div class="spec">
<p><tt>reload() -&gt; ok</tt></p>
-<p>Reload the existing database in this process and then change the
+</div><p>Reload the existing database in this process and then change the
state of the running server.</p>
-<h3><a name="reload-1">reload/1</a></h3>
+<h3 class="function"><a name="reload-1">reload/1</a></h3>
+<div class="spec">
<p><tt>reload(FileName::Path) -&gt; ok</tt></p>
-<p>Load the database at Path in this process and then change the
+</div><p>Load the database at Path in this process and then change the
state of the running server with the new database.</p>
-<h3><a name="start-0">start/0</a></h3>
+<h3 class="function"><a name="start-0">start/0</a></h3>
+<div class="spec">
<p><tt>start() -&gt; {ok, Pid}</tt></p>
-<p>Start the server using the default priv/GeoLitecity.dat.gz database.</p>
+</div><p>Start the server using the default priv/GeoLitecity.dat.gz database.</p>
-<h3><a name="start-1">start/1</a></h3>
+<h3 class="function"><a name="start-1">start/1</a></h3>
+<div class="spec">
<p><tt>start(FileName::Path) -&gt; {ok, Pid}</tt></p>
-<p>Start the server using the database at Path.</p>
+</div><p>Start the server using the database at Path.</p>
-<h3><a name="stop-0">stop/0</a></h3>
+<h3 class="function"><a name="stop-0">stop/0</a></h3>
+<div class="spec">
<p><tt>stop() -&gt; ok</tt></p>
-<p>Stop the server.</p>
+</div><p>Stop the server.</p>
-<h3><a name="terminate-2">terminate/2</a></h3>
+<h3 class="function"><a name="terminate-2">terminate/2</a></h3>
+<div class="spec">
<p><tt>terminate(Reason, State) -&gt; ok</tt></p>
-<p>gen_server callback.</p>
+</div><p>gen_server callback.</p>
+<hr>
+
+<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
+<p><i>Generated by EDoc, May 16 2007, 11:05:25.</i></p>
</body>
</html>
View
30 doc/egeoip_app.html
@@ -2,30 +2,38 @@
<html>
<head>
<title>Module egeoip_app</title>
-<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
+<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
+<hr>
<h1>Module egeoip_app</h1>
-
+<ul class="index"><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>
<p>Copyright © 2006 Bob Ippolito</p>
-<ul><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>
+
<p><b>Behaviours:</b> <a href="application.html"><tt>application</tt></a>.</p>
<p><b>Authors:</b> Bob Ippolito (<a href="mailto:bob@redivi.com"><tt>bob@redivi.com</tt></a>).</p>
<h2><a name="index">Function Index</a></h2>
-<table width="100%" border="1"><tr><td valign="top"><a href="#start-2">start/2</a></td><td/></tr>
-<tr><td valign="top"><a href="#stop-1">stop/1</a></td><td/></tr>
+<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#start-2">start/2</a></td><td></td></tr>
+<tr><td valign="top"><a href="#stop-1">stop/1</a></td><td></td></tr>
</table>
<h2><a name="functions">Function Details</a></h2>
-<h3><a name="start-2">start/2</a></h3>
-<tt>start(Type, StartArgs) -&gt; term()
-</tt>
+<h3 class="function"><a name="start-2">start/2</a></h3>
+<div class="spec">
+<p><tt>start() -&gt; term()</tt></p>
+</div>
+
+<h3 class="function"><a name="stop-1">stop/1</a></h3>
+<div class="spec">
+<p><tt>stop() -&gt; term()</tt></p>
+</div>
+<hr>
-<h3><a name="stop-1">stop/1</a></h3>
-<tt>stop(State) -&gt; term()
-</tt>
+<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
+<p><i>Generated by EDoc, May 16 2007, 11:05:26.</i></p>
</body>
</html>
View
30 doc/egeoip_sup.html
@@ -2,30 +2,38 @@
<html>
<head>
<title>Module egeoip_sup</title>
-<link rel="stylesheet" type="text/css" href="stylesheet.css">
+<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
+<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
+<hr>
<h1>Module egeoip_sup</h1>
-
+<ul class="index"><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>
<p>Copyright © 2006 Bob Ippolito</p>
-<ul><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>
+
<p><b>Behaviours:</b> <a href="supervisor.html"><tt>supervisor</tt></a>.</p>
<p><b>Authors:</b> Bob Ippolito (<a href="mailto:bob@redivi.com"><tt>bob@redivi.com</tt></a>).</p>
<h2><a name="index">Function Index</a></h2>
-<table width="100%" border="1"><tr><td valign="top"><a href="#init-1">init/1</a></td><td/></tr>
-<tr><td valign="top"><a href="#start_link-0">start_link/0</a></td><td/></tr>
+<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#init-1">init/1</a></td><td></td></tr>
+<tr><td valign="top"><a href="#start_link-0">start_link/0</a></td><td></td></tr>
</table>
<h2><a name="functions">Function Details</a></h2>
-<h3><a name="init-1">init/1</a></h3>
-<tt>init(X1) -&gt; term()
-</tt>
+<h3 class="function"><a name="init-1">init/1</a></h3>
+<div class="spec">
+<p><tt>init() -&gt; term()</tt></p>
+</div>
+
+<h3 class="function"><a name="start_link-0">start_link/0</a></h3>
+<div class="spec">
+<p><tt>start_link() -&gt; term()</tt></p>
+</div>
+<hr>
-<h3><a name="start_link-0">start_link/0</a></h3>
-<tt>start_link() -&gt; term()
-</tt>
+<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
+<p><i>Generated by EDoc, May 16 2007, 11:05:27.</i></p>
</body>
</html>
View
BIN  ebin/egeoip.beam
Binary file not shown
View
BIN  ebin/egeoip_app.beam
Binary file not shown
View
BIN  ebin/egeoip_sup.beam
Binary file not shown
View
9 src/Makefile
@@ -1,14 +1,9 @@
-
include ../support/include.mk
-include ../vsn.mk
-VSN=$(ESWF_VSN)
-
-EBIN_FILES = $(ERL_OBJECTS) $(ERL_DOCUMENTS) ../ebin/egeoip.app
-MODULES = $(ERL_SOURCES:%.erl=%)
-
all: $(EBIN_FILES)
+local: $(ERL_OBJECTS_LOCAL)
+
debug:
$(MAKE) DEBUG=-DDEBUG
View
8 src/egeoip.app.src
@@ -1,8 +0,0 @@
-{application,egeoip,
- [{description,"geolocation by IP"},
- {vsn,"0.01"},
- {modules,[egeoip, egeoip_app, egeoip_sup]},
- {registered, []},
- {env, [{dbfile, city}]},
- {mod, {egeoip_app, []}},
- {applications,[kernel,stdlib]}]}.
View
23 support/create_release.sh
@@ -1,23 +0,0 @@
-#!/bin/sh
-#
-# Function: Run it from the jungerl/lib/$App directory
-# in order to create a new release tar-ball.
-#
-
-CUR=`pwd`
-APP=`basename ${CUR}`
-VSN=`cat vsn.mk | sed -e 's/.*=//'`
-DIR=release/${APP}-${VSN}
-
-mkdir -p ${DIR}
-mkdir -p ${DIR}/ebin
-
-for i in `ls -d * | sed -e 's/release//g'`
-do
- [ -d ${i} ] && cp -Rp ${i} ${DIR} && rm -rf ${DIR}/${i}/CVS
- [ -f ${i} ] && cp -p ${i} ${DIR}
-done
-rm -rf ${DIR}/CVS
-rm -rf ${DIR}/ebin/*.beam
-
-(cd release; tar cvzf ${APP}-${VSN}.tar.gz ${APP}-${VSN}; rm -rf ${APP}-${VSN})
View
34 support/include.mk
@@ -3,14 +3,11 @@
######################################################################
## Erlang
-PREFIX := /usr/local
-ERL := $(PREFIX)/bin/erl
-ERLC := $(PREFIX)/bin/erlc
+ERL := erl
+ERLC := $(ERL)c
-ERLDIR := $(PREFIX)/lib/erlang
-ERL_C_INCLUDE_DIR := $(ERLDIR)/usr/include
-
-ERLC_FLAGS := -W -I ../include
+INCLUDE_DIRS := ../include $(wildcard ../deps/*/include)
+ERLC_FLAGS := -W $(INCLUDE_DIRS:../%=-I ../%)
ifndef no_debug_info
ERLC_FLAGS += +debug_info
@@ -28,25 +25,20 @@ ERL_SOURCES := $(wildcard *.erl)
ERL_HEADERS := $(wildcard *.hrl) $(wildcard ../include/*.hrl)
ERL_OBJECTS := $(ERL_SOURCES:%.erl=$(EBIN_DIR)/%.$(EMULATOR))
ERL_DOCUMENTS := $(ERL_SOURCES:%.erl=$(DOC_DIR)/%.html)
+ERL_OBJECTS_LOCAL := $(ERL_SOURCES:%.erl=./%.$(EMULATOR))
+APP_FILES := $(wildcard *.app)
+EBIN_FILES = $(ERL_OBJECTS) $(ERL_DOCUMENTS) $(APP_FILES:%.app=../ebin/%.app)
+MODULES = $(ERL_SOURCES:%.erl=%)
-# Hmm, don't know if you are supposed to like this better... ;-)
-APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/%VSN%/$$vsn/; s/%MODULES%/$$mods/; print; }'
-
-../ebin/%.app: %.app.src ../vsn.mk Makefile
- perl -e $(APPSCRIPT) "$(VSN)" $(MODULES) < $< > $@
+../ebin/%.app: %.app
+ cp $< $@
$(EBIN_DIR)/%.$(EMULATOR): %.erl
$(ERLC) $(ERLC_FLAGS) -o $(EBIN_DIR) $<
-# generate documentation with edoc:
-# this is still not the proper way to do it, but it works
-# (see the wumpus application for an example)
+./%.$(EMULATOR): %.erl
+ $(ERLC) $(ERLC_FLAGS) -o . $<
$(DOC_DIR)/%.html: %.erl
- ${ERL} -noshell \
- -pa ../../syntax_tools/ebin \
- -pa ../../edoc/ebin \
- -pa ../../xmerl/ebin \
- -pa ../../ucs/ebin \
- -run edoc file $< -run init stop
+ $(ERL) -noshell -run edoc file $< -run init stop
mv *.html $(DOC_DIR)
View
1  vsn.mk
@@ -1 +0,0 @@
-EGEOIP_VSN=0.1

0 comments on commit 9c979a2

Please sign in to comment.
Something went wrong with that request. Please try again.