From be2726a22f40ad096d0f9d88cb350aa32f00217d Mon Sep 17 00:00:00 2001 From: Olaf Rempel Date: Tue, 17 Apr 2007 14:23:19 +0200 Subject: [PATCH] subdirs --- Makefile | 24 ++++++++-------------- hlswmaster.conf | 18 ++++++++-------- configfile.h => include/configfile.h | 0 event.h => include/event.h | 0 gamelist.h => include/gamelist.h | 0 list.h => include/list.h | 0 logging.h => include/logging.h | 0 netpkt.h => include/netpkt.h | 0 plugin.h => include/plugin.h | 0 plugin_helper.h => include/plugin_helper.h | 0 scanner.h => include/scanner.h | 0 server.h => include/server.h | 0 plugins/.gitignore | 3 +++ plugins/Makefile | 22 ++++++++++++++++++++ p_d3engine.c => plugins/d3engine.c | 0 p_gamespy1.c => plugins/gamespy1.c | 0 p_gamespy2.c => plugins/gamespy2.c | 0 p_halflife.c => plugins/halflife.c | 0 p_hlswproxy.c => plugins/hlswproxy.c | 0 p_q3engine.c => plugins/q3engine.c | 0 p_quake2.c => plugins/quake2.c | 0 p_ut2k4.c => plugins/ut2k4.c | 0 22 files changed, 43 insertions(+), 24 deletions(-) rename configfile.h => include/configfile.h (100%) rename event.h => include/event.h (100%) rename gamelist.h => include/gamelist.h (100%) rename list.h => include/list.h (100%) rename logging.h => include/logging.h (100%) rename netpkt.h => include/netpkt.h (100%) rename plugin.h => include/plugin.h (100%) rename plugin_helper.h => include/plugin_helper.h (100%) rename scanner.h => include/scanner.h (100%) rename server.h => include/server.h (100%) create mode 100644 plugins/.gitignore create mode 100644 plugins/Makefile rename p_d3engine.c => plugins/d3engine.c (100%) rename p_gamespy1.c => plugins/gamespy1.c (100%) rename p_gamespy2.c => plugins/gamespy2.c (100%) rename p_halflife.c => plugins/halflife.c (100%) rename p_hlswproxy.c => plugins/hlswproxy.c (100%) rename p_q3engine.c => plugins/q3engine.c (100%) rename p_quake2.c => plugins/quake2.c (100%) rename p_ut2k4.c => plugins/ut2k4.c (100%) diff --git a/Makefile b/Makefile index 8461f27..3edb6bc 100644 --- a/Makefile +++ b/Makefile @@ -1,35 +1,29 @@ VERSION := v2.00 -CFLAGS := -O2 -pipe -Wall -DVERSION='"$(VERSION)"' +CFLAGS := -O2 -pipe -Wall -Iinclude -DVERSION='"$(VERSION)"' LDFLAGS := -ldl -rdynamic -HLSWMASTER_SRC := configfile.o event.o gamelist.o hlswmaster.o logging.o \ - netpkt.o plugin.o plugin_helper.o scanner.o server.o - -PLUGINS := $(wildcard p_*.c) +OBJS := configfile.o event.o gamelist.o logging.o netpkt.o plugin.o \ + plugin_helper.o scanner.o server.o -all: hlswmaster masterquery $(PLUGINS:.c=.so) +all: hlswmaster masterquery + make -C plugins all -hlswmaster: $(HLSWMASTER_SRC) +hlswmaster: $(OBJS) hlswmaster.o $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@ masterquery: masterquery.o - $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@ + $(CC) $(CFLAGS) $^ -o $@ %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ -%.so: %_sh.o - $(LD) -shared -o $@ $< - -%_sh.o: %.c - $(CC) $(CFLAGS) -fPIC -c $< -o $@ - %.d: %.c $(CC) $(CFLAGS) -MM -c $< -o $@ clean: - rm -f hlswmaster masterquery *.so *.d *.o *.log + rm -f hlswmaster masterquery *.d *.o *.log + make -C plugins clean DEPS := $(wildcard *.c) -include $(DEPS:.c=.d) diff --git a/hlswmaster.conf b/hlswmaster.conf index 33fff46..6def817 100644 --- a/hlswmaster.conf +++ b/hlswmaster.conf @@ -14,15 +14,15 @@ ## master answers with this source IP #master_src 0.0.0.0:7140 -#plugin_dir . -plugin p_d3engine.so -plugin p_gamespy1.so -plugin p_gamespy2.so -plugin p_halflife.so -plugin p_hlswproxy.so -plugin p_q3engine.so -plugin p_quake2.so -plugin p_ut2k4.so +plugin_dir plugins +plugin d3engine.so +plugin gamespy1.so +plugin gamespy2.so +plugin halflife.so +plugin hlswproxy.so +plugin q3engine.so +plugin quake2.so +plugin ut2k4.so ## logging #logfile hlswmaster.log diff --git a/configfile.h b/include/configfile.h similarity index 100% rename from configfile.h rename to include/configfile.h diff --git a/event.h b/include/event.h similarity index 100% rename from event.h rename to include/event.h diff --git a/gamelist.h b/include/gamelist.h similarity index 100% rename from gamelist.h rename to include/gamelist.h diff --git a/list.h b/include/list.h similarity index 100% rename from list.h rename to include/list.h diff --git a/logging.h b/include/logging.h similarity index 100% rename from logging.h rename to include/logging.h diff --git a/netpkt.h b/include/netpkt.h similarity index 100% rename from netpkt.h rename to include/netpkt.h diff --git a/plugin.h b/include/plugin.h similarity index 100% rename from plugin.h rename to include/plugin.h diff --git a/plugin_helper.h b/include/plugin_helper.h similarity index 100% rename from plugin_helper.h rename to include/plugin_helper.h diff --git a/scanner.h b/include/scanner.h similarity index 100% rename from scanner.h rename to include/scanner.h diff --git a/server.h b/include/server.h similarity index 100% rename from server.h rename to include/server.h diff --git a/plugins/.gitignore b/plugins/.gitignore new file mode 100644 index 0000000..fd9c310 --- /dev/null +++ b/plugins/.gitignore @@ -0,0 +1,3 @@ +*.o +*.so +*.d diff --git a/plugins/Makefile b/plugins/Makefile new file mode 100644 index 0000000..8a1ffd4 --- /dev/null +++ b/plugins/Makefile @@ -0,0 +1,22 @@ +PLUGINS := $(wildcard *.c) +CFLAGS := -O2 -pipe -Wall -I../include + +all: $(PLUGINS:.c=.so) + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +%.so: %_sh.o + $(LD) -shared -o $@ $< + +%_sh.o: %.c + $(CC) $(CFLAGS) -fPIC -c $< -o $@ + +%.d: %.c + $(CC) $(CFLAGS) -MM -c $< -o $@ + +clean: + rm -f *.so *.d *.o + +DEPS := $(wildcard *.c) +-include $(DEPS:.c=.d) diff --git a/p_d3engine.c b/plugins/d3engine.c similarity index 100% rename from p_d3engine.c rename to plugins/d3engine.c diff --git a/p_gamespy1.c b/plugins/gamespy1.c similarity index 100% rename from p_gamespy1.c rename to plugins/gamespy1.c diff --git a/p_gamespy2.c b/plugins/gamespy2.c similarity index 100% rename from p_gamespy2.c rename to plugins/gamespy2.c diff --git a/p_halflife.c b/plugins/halflife.c similarity index 100% rename from p_halflife.c rename to plugins/halflife.c diff --git a/p_hlswproxy.c b/plugins/hlswproxy.c similarity index 100% rename from p_hlswproxy.c rename to plugins/hlswproxy.c diff --git a/p_q3engine.c b/plugins/q3engine.c similarity index 100% rename from p_q3engine.c rename to plugins/q3engine.c diff --git a/p_quake2.c b/plugins/quake2.c similarity index 100% rename from p_quake2.c rename to plugins/quake2.c diff --git a/p_ut2k4.c b/plugins/ut2k4.c similarity index 100% rename from p_ut2k4.c rename to plugins/ut2k4.c