aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--c_src/Makefile29
-rw-r--r--c_src/io.c (renamed from src/io.c)0
-rw-r--r--c_src/io.h (renamed from src/io.h)0
-rw-r--r--c_src/log.c (renamed from src/log.c)0
-rw-r--r--c_src/log.h (renamed from src/log.h)0
-rw-r--r--c_src/msg.c (renamed from src/msg.c)0
-rw-r--r--c_src/msg.h (renamed from src/msg.h)0
-rw-r--r--c_src/mysqlerl.c (renamed from src/mysqlerl.c)0
-rw-r--r--src/Makefile29
10 files changed, 35 insertions, 25 deletions
diff --git a/Makefile b/Makefile
index 06d59c1..f957861 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
.PHONY: all install test clean
all:
+ @cd c_src && make all
@cd src && make all
install:
@@ -10,5 +11,6 @@ test: all
@cd test && make test
clean:
+ @cd c_src && make clean
@cd src && make clean
@cd test && make clean
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)
diff --git a/src/io.c b/c_src/io.c
index 565b1ac..565b1ac 100644
--- a/src/io.c
+++ b/c_src/io.c
diff --git a/src/io.h b/c_src/io.h
index bf4e086..bf4e086 100644
--- a/src/io.h
+++ b/c_src/io.h
diff --git a/src/log.c b/c_src/log.c
index 80aa755..80aa755 100644
--- a/src/log.c
+++ b/c_src/log.c
diff --git a/src/log.h b/c_src/log.h
index ae9a9bd..ae9a9bd 100644
--- a/src/log.h
+++ b/c_src/log.h
diff --git a/src/msg.c b/c_src/msg.c
index 65926b4..65926b4 100644
--- a/src/msg.c
+++ b/c_src/msg.c
diff --git a/src/msg.h b/c_src/msg.h
index 6db2aa8..6db2aa8 100644
--- a/src/msg.h
+++ b/c_src/msg.h
diff --git a/src/mysqlerl.c b/c_src/mysqlerl.c
index 5c67517..5c67517 100644
--- a/src/mysqlerl.c
+++ b/c_src/mysqlerl.c
diff --git a/src/Makefile b/src/Makefile
index ab690a5..7fb96de 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,44 +1,23 @@
-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
+BINS = $(BEAMDIR)/mysqlerl.app
BEAMS = mysqlerl.beam mysqlerl_app.beam mysqlerl_connection.beam \
mysqlerl_port.beam mysqlerl_port_sup.beam mysqlerl_sup.beam
-all: $(PRIVDIR) $(BEAMDIR) $(BINS)
+all: $(BEAMDIR) $(BINS)
clean:
- rm -rf *.o *.beam
- rm -rf $(BINS) $(MYSQLERLOBJS) $(BEAMS) $(BEAMDIR)/mysqlerl.app
+ rm -rf *.beam
+ rm -rf $(BINS) $(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)