aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2012-02-06 20:15:48 -0500
committerBrian Cully <github.20.shmit@spamgourmet.com>2012-02-06 20:15:48 -0500
commit10b824963ff7b0b012e6b85c8b3f07904c473fd1 (patch)
tree344e00f788ea24c273f841636bdf92f354b40e2c /src/Makefile
parent591169f86718117151bf9eb5960ba58e2a27a5bb (diff)
downloadmysqlerl-10b824963ff7b0b012e6b85c8b3f07904c473fd1.tar.gz
mysqlerl-10b824963ff7b0b012e6b85c8b3f07904c473fd1.zip
Remove stupid lib directory
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..4782487
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,45 @@
+ERLPREFIX = /usr/local
+ERLINTERFACE = erl_interface-3.7.6
+ERLINCS = -I$(ERLPREFIX)/lib/erlang/lib/$(ERLINTERFACE)/include
+ERLLIBS = -L$(ERLPREFIX)/lib/erlang/lib/$(ERLINTERFACE)/lib \
+ -lerl_interface -lei
+
+MYSQLPREFIX = /usr/local/mysql
+MYSQLINCS = -I$(MYSQLPREFIX)/include
+#MYSQLLIBS = -L$(MYSQLPREFIX)/lib -lmysqlclient
+MYSQLLIBS = $(MYSQLPREFIX)/lib/libmysqlclient.a
+
+CFLAGS = -g -Wall -Werror $(MYSQLINCS) $(ERLINCS)
+LDFLAGS = $(MYSQLLIBS) $(ERLLIBS)
+EFLAGS = -W +debug_info
+
+PRIVDIR = ../priv
+BEAMDIR = ../ebin
+
+BINS = $(PRIVDIR)/mysqlerl $(BEAMDIR)/mysqlerl.app
+MYSQLERLOBJS = io.o log.o msg.o mysqlerl.o
+BEAMS = mysqlerl.beam mysqlerl_app.beam mysqlerl_connection.beam \
+ mysqlerl_connection_sup.beam mysqlerl_port.beam \
+ mysqlerl_port_sup.beam mysqlerl_sup.beam
+
+all: $(PRIVDIR) $(BEAMDIR) $(BINS)
+
+clean:
+ rm -rf *.o *.beam
+ rm -rf $(BINS) $(MYSQLERLOBJS) $(BEAMS) $(BEAMDIR)/mysqlerl.app
+
+%.beam: %.erl
+ erlc $(EFLAGS) $<
+
+$(PRIVDIR)/mysqlerl: $(PRIVDIR) $(MYSQLERLOBJS)
+ $(CC) -o $@ $(MYSQLERLOBJS) $(LDFLAGS)
+
+$(BEAMDIR)/mysqlerl.app: $(BEAMDIR) $(BEAMS)
+ cp $(BEAMS) $(BEAMDIR)
+ cp mysqlerl.app $(BEAMDIR)
+
+$(PRIVDIR):
+ mkdir -p $(PRIVDIR)
+
+$(BEAMDIR):
+ mkdir -p $(BEAMDIR)