2018-09-19 15:07:14 +02:00
|
|
|
include var.mk
|
2017-07-29 22:00:34 +02:00
|
|
|
LIB_PATH=$(BUILDIRD)/plugins
|
|
|
|
LIB_NAME=libantd
|
2017-06-11 16:33:48 +02:00
|
|
|
LIB_FLAG= $(LIB_NAME).$(EXT)
|
2018-02-10 17:02:17 +01:00
|
|
|
SERVERLIB= -ldl $(LIB_FLAG) $(DB_LIB) $(SSL_LIB) -lpthread
|
2017-07-29 22:00:34 +02:00
|
|
|
|
|
|
|
SERVER_O=plugin_manager.o \
|
2017-07-30 01:00:36 +02:00
|
|
|
http_server.o
|
2015-10-22 11:39:11 +02:00
|
|
|
#-lsocket
|
|
|
|
|
2018-02-09 13:13:11 +01:00
|
|
|
LIBOBJS = libs/ini.o \
|
|
|
|
libs/handle.o \
|
2017-07-29 22:00:34 +02:00
|
|
|
$(DB_OBJ) \
|
2018-02-09 13:13:11 +01:00
|
|
|
libs/dictionary.o \
|
|
|
|
libs/base64.o \
|
|
|
|
libs/utils.o \
|
|
|
|
libs/ws.o \
|
|
|
|
libs/sha1.o \
|
2018-09-25 17:51:56 +02:00
|
|
|
libs/list.o \
|
|
|
|
libs/scheduler.o
|
2017-07-29 22:00:34 +02:00
|
|
|
|
2018-02-09 13:13:11 +01:00
|
|
|
PLUGINSDEP = libs/plugin.o
|
2017-07-29 22:00:34 +02:00
|
|
|
|
2015-10-22 11:39:11 +02:00
|
|
|
|
2018-09-19 15:07:14 +02:00
|
|
|
main: initd httpd antd_plugins
|
2015-10-22 11:39:11 +02:00
|
|
|
|
2018-03-19 11:32:10 +01:00
|
|
|
initd:
|
2018-03-19 11:35:56 +01:00
|
|
|
-mkdir -p $(LIB_PATH)
|
2015-10-22 11:39:11 +02:00
|
|
|
|
2017-07-29 22:00:34 +02:00
|
|
|
httpd: lib $(SERVER_O)
|
2018-02-10 17:07:19 +01:00
|
|
|
$(CC) $(CFLAGS) $(SERVER_O) -o $(BUILDIRD)/httpd httpd.c $(SERVERLIB)
|
2016-10-31 20:59:27 +01:00
|
|
|
cp antd $(BUILDIRD)
|
2015-10-22 11:39:11 +02:00
|
|
|
|
2018-09-25 17:51:56 +02:00
|
|
|
relay: lib $(SERVER_O)
|
|
|
|
$(CC) $(CFLAGS) $(SERVER_O) -o $(BUILDIRD)/relay relay.c $(SERVERLIB)
|
|
|
|
cp relayd $(BUILDIRD)
|
2017-07-29 22:00:34 +02:00
|
|
|
lib: $(LIBOBJS)
|
2018-02-10 11:22:41 +01:00
|
|
|
$(CC) $(CFLAGS) $(DB_LIB) $(SSL_LIB) -shared -o $(LIB_NAME).$(EXT) $(LIBOBJS)
|
2017-06-11 16:33:48 +02:00
|
|
|
cp $(LIB_NAME).$(EXT) $(LIB_PATH$)/
|
2015-10-22 11:39:11 +02:00
|
|
|
%.o: %.c
|
2016-11-23 23:33:49 +01:00
|
|
|
$(CC) -fPIC $(CFLAGS) -c $< -o $@
|
2017-07-29 22:00:34 +02:00
|
|
|
|
2018-09-19 15:07:14 +02:00
|
|
|
antd_plugins:
|
|
|
|
- echo "make plugin"
|
|
|
|
-for file in plugins/* ; do\
|
|
|
|
echo $$file;\
|
|
|
|
if [ -d "$$file" ]; then \
|
|
|
|
make -C "$$file"; \
|
|
|
|
fi \
|
2015-10-22 11:39:11 +02:00
|
|
|
done
|
|
|
|
|
2018-09-20 00:02:53 +02:00
|
|
|
plugin:
|
|
|
|
read -r -p "Enter package name: " PKG;\
|
|
|
|
cd plugins/$$PKG && make clean && make\
|
2015-10-22 11:39:11 +02:00
|
|
|
|
|
|
|
clean: sclean pclean
|
|
|
|
|
|
|
|
sclean:
|
2017-07-29 22:00:34 +02:00
|
|
|
-rm -f *.o $(BUILDIRD)/httpd
|
|
|
|
-rm *.$(EXT)
|
2015-10-22 11:39:11 +02:00
|
|
|
pclean:
|
2018-02-10 11:22:41 +01:00
|
|
|
-rm -rf $(BUILDIRD)/plugins/* libs/*.o
|
2018-09-19 15:07:14 +02:00
|
|
|
-for file in plugins/* ;do \
|
2015-10-22 11:39:11 +02:00
|
|
|
if [ -d "$$file" ]; then \
|
2018-09-19 15:07:14 +02:00
|
|
|
make -C "$$file" clean; \
|
2015-10-22 11:39:11 +02:00
|
|
|
fi \
|
|
|
|
done
|
2016-12-12 20:17:05 +01:00
|
|
|
.PRECIOUS: %.o
|