aboutsummaryrefslogtreecommitdiffstats
path: root/c_src/Makefile
diff options
context:
space:
mode:
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)