aboutsummaryrefslogtreecommitdiffstats
path: root/c_src/Makefile
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2012-02-09 14:13:57 -0500
committerBrian Cully <bjc@kublai.com>2012-02-09 14:13:57 -0500
commit8cd5a7f161743d6b6a995b92b1702909809b8cdc (patch)
tree5a12ddc4b5f0f5a8d70d126cbdc52451e55bdac9 /c_src/Makefile
parenta5424fc5ebde59b8335e99a062e208a80235977f (diff)
downloadmysqlerl-8cd5a7f161743d6b6a995b92b1702909809b8cdc.tar.gz
mysqlerl-8cd5a7f161743d6b6a995b92b1702909809b8cdc.zip
Move C code into c_src
Diffstat (limited to 'c_src/Makefile')
-rw-r--r--c_src/Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/c_src/Makefile b/c_src/Makefile
new file mode 100644
index 0000000..29eec47
--- /dev/null
+++ b/c_src/Makefile
@@ -0,0 +1,29 @@
+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)
+
+PRIVDIR = ../priv
+
+BINS = $(PRIVDIR)/mysqlerl
+OBJS = io.o log.o msg.o mysqlerl.o
+
+all: $(BINS)
+
+clean:
+ rm -rf *.o $(BINS)
+
+$(PRIVDIR)/mysqlerl: $(PRIVDIR) $(OBJS)
+ $(CC) -o $@ $(OBJS) $(LDFLAGS)
+
+$(PRIVDIR):
+ mkdir -p $(PRIVDIR)