2009-02-17 10:41:34 -05:00
|
|
|
PWD=$(shell pwd)
|
|
|
|
INCS=-I$(PWD)/src/include
|
2008-12-19 19:35:09 -05:00
|
|
|
LIBEDIT_DIR=../../libs/libedit
|
2008-12-21 16:54:43 -05:00
|
|
|
DEBUG=-g -ggdb
|
2009-02-16 19:27:28 -05:00
|
|
|
BASE_FLAGS=$(INCS) -DHAVE_EDITLINE $(DEBUG) -I$(LIBEDIT_DIR)/src/ -fPIC
|
2008-12-21 16:54:43 -05:00
|
|
|
PICKY=-O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
|
2009-02-16 19:27:28 -05:00
|
|
|
CFLAGS=$(BASE_FLAGS) $(PICKY)
|
2009-03-11 16:51:44 -04:00
|
|
|
CXXFLAGS=$(BASE_FLAGS) -Wall -Werror -Wno-unused-variable
|
2008-12-19 19:35:09 -05:00
|
|
|
MYLIB=libesl.a
|
2008-12-26 12:54:30 -05:00
|
|
|
LIBS=-lncurses -lpthread -lesl
|
2008-12-20 10:40:33 -05:00
|
|
|
LDFLAGS=-L.
|
2008-12-20 00:24:51 -05:00
|
|
|
OBJS=src/esl.o src/esl_event.o src/esl_threadmutex.o src/esl_config.o
|
2009-02-16 19:27:28 -05:00
|
|
|
SRC=src/esl.c src/esl_event.c src/esl_threadmutex.c src/esl_config.c src/esl_oop.cpp
|
|
|
|
HEADERS=src/include/esl_config.h src/include/esl_event.h src/include/esl.h src/include/esl_threadmutex.h src/include/esl_oop.h
|
|
|
|
SOLINK=-shared -Xlinker -x
|
|
|
|
# comment the next line to disable c++ (no swig mods for you then)
|
|
|
|
OBJS += src/esl_oop.o
|
2008-12-19 19:35:09 -05:00
|
|
|
|
2008-12-20 10:40:33 -05:00
|
|
|
all: $(MYLIB) fs_cli testclient testserver
|
2008-12-19 19:35:09 -05:00
|
|
|
|
2008-12-21 16:54:43 -05:00
|
|
|
$(MYLIB): $(OBJS) $(HEADERS) $(SRC)
|
2008-12-19 19:35:09 -05:00
|
|
|
ar rcs $(MYLIB) $(OBJS)
|
|
|
|
ranlib $(MYLIB)
|
|
|
|
|
2008-12-20 10:40:33 -05:00
|
|
|
testserver: $(MYLIB) testserver.c
|
|
|
|
$(CC) $(CC_CFLAGS) $(CFLAGS) testserver.c -o testserver $(LDFLAGS) $(LIBS)
|
2008-12-19 19:35:09 -05:00
|
|
|
|
2008-12-20 10:40:33 -05:00
|
|
|
testclient: $(MYLIB) testclient.c
|
|
|
|
$(CC) $(CC_CFLAGS) $(CFLAGS) testclient.c -o testclient $(LDFLAGS) $(LIBS)
|
2008-12-19 19:35:09 -05:00
|
|
|
|
|
|
|
fs_cli: $(MYLIB) fs_cli.c
|
2008-12-20 10:40:33 -05:00
|
|
|
$(CC) $(CC_CFLAGS) $(CFLAGS) fs_cli.c -o fs_cli $(LDFLAGS) -L$(LIBEDIT_DIR)/src/.libs $(LIBS) -ledit
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@
|
2008-12-19 19:35:09 -05:00
|
|
|
|
2009-02-16 19:27:28 -05:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CXX) $(CXX_CFLAGS) $(CXXFLAGS) -c $< -o $@
|
|
|
|
|
2008-12-19 19:35:09 -05:00
|
|
|
clean:
|
2009-02-17 10:41:34 -05:00
|
|
|
rm -f *.o src/*.o testclient testserver fs_cli libesl.a *~ src/*~ src/include/*~
|
|
|
|
make -C perl clean
|
2009-02-17 10:54:36 -05:00
|
|
|
make -C php clean
|
2009-02-17 11:02:26 -05:00
|
|
|
make -C lua clean
|
2009-02-17 11:06:02 -05:00
|
|
|
make -C python clean
|
2009-02-17 11:12:03 -05:00
|
|
|
make -C ruby clean
|
2009-02-16 19:27:28 -05:00
|
|
|
|
2009-02-17 10:41:34 -05:00
|
|
|
reswig: swigclean
|
|
|
|
make -C perl reswig
|
2009-02-17 10:54:36 -05:00
|
|
|
make -C php reswig
|
2009-02-17 11:06:02 -05:00
|
|
|
make -C lua reswig
|
|
|
|
make -C python reswig
|
2009-02-17 11:12:03 -05:00
|
|
|
make -C ruby reswig
|
2009-02-17 11:06:02 -05:00
|
|
|
|
2009-02-16 19:27:28 -05:00
|
|
|
swigclean: clean
|
2009-02-17 10:41:34 -05:00
|
|
|
make -C perl swigclean
|
2009-02-17 10:54:36 -05:00
|
|
|
make -C php swigclean
|
2009-02-17 11:02:26 -05:00
|
|
|
make -C lua swigclean
|
2009-02-17 11:06:02 -05:00
|
|
|
make -C python swigclean
|
2009-02-17 11:12:03 -05:00
|
|
|
make -C ruby swigclean
|
2009-02-16 19:27:28 -05:00
|
|
|
|
2009-02-17 10:46:18 -05:00
|
|
|
perlmod: $(MYLIB)
|
|
|
|
make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C perl
|
2009-02-16 19:27:28 -05:00
|
|
|
|
2009-02-17 10:54:36 -05:00
|
|
|
phpmod: $(MYLIB)
|
2009-02-17 18:33:42 -05:00
|
|
|
make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C php
|
2009-02-17 10:54:36 -05:00
|
|
|
|
2009-02-17 11:02:26 -05:00
|
|
|
luamod: $(MYLIB)
|
|
|
|
make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C lua
|
|
|
|
|
2009-02-17 11:06:02 -05:00
|
|
|
pymod: $(MYLIB)
|
|
|
|
make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C python
|
|
|
|
|
2009-02-17 11:12:03 -05:00
|
|
|
rubymod: $(MYLIB)
|
|
|
|
make MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C ruby
|
|
|
|
|
2009-02-17 17:12:17 -05:00
|
|
|
phpmod-install: phpmod
|
2009-02-17 16:41:06 -05:00
|
|
|
make -C php install
|
|
|
|
|
2009-02-17 11:44:57 -05:00
|
|
|
everymod: perlmod phpmod luamod pymod rubymod
|