aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2008-03-01 13:10:46 -0500
committerBrian Cully <bjc@kublai.com>2008-03-01 13:10:46 -0500
commit8ffa0cdb1f19cd56d7adf63893e5d158daa9aa3c (patch)
treef304bbcc3543be536089fafcad2fa4d3fc2fbd5f /src/Makefile
downloadmysqlerl-8ffa0cdb1f19cd56d7adf63893e5d158daa9aa3c.tar.gz
mysqlerl-8ffa0cdb1f19cd56d7adf63893e5d158daa9aa3c.zip
Initial commit
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..3978bf0
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,34 @@
+CFLAGS = -I/usr/local/mysql/include -O2 -g
+LDFLAGS = -L/usr/local/mysql/lib
+EFLAGS = -W +debug_info
+
+PRIVDIR = ../priv
+BEAMDIR = ../ebin
+
+BINS = $(PRIVDIR)/mysqlerl $(BEAMDIR)/mysqlerl.app
+MYSQLERLOBJS = mysqlerl.o
+BEAMS = mysqlerl.beam mysqlerl_app.beam mysqlerl_connection.beam \
+ mysqlerl_connection_sup.beam
+LIBS = -lmysqlclient
+
+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 $@ $(LDFLAGS) $(MYSQLERLOBJS) $(LIBS)
+
+$(BEAMDIR)/mysqlerl.app: $(BEAMDIR) $(BEAMS)
+ cp $(BEAMS) $(BEAMDIR)
+ cp mysqlerl.app $(BEAMDIR)
+
+$(PRIVDIR):
+ mkdir -p $(PRIVDIR)
+
+$(BEAMDIR):
+ mkdir -p $(BEAMDIR) \ No newline at end of file