summaryrefslogtreecommitdiff
path: root/src/master/Makefile
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2005-12-28 02:32:43 +0000
committerTim Angus <tim@ngus.net>2005-12-28 02:32:43 +0000
commit1dc7e94283f026b17c1e793cbf7542872812ffda (patch)
tree33de56bca208626f1e7c77853255afc2b8244279 /src/master/Makefile
parent4b614e63d7da358a8a30e61a89365add79ecde9c (diff)
* Added master server to source, based on dpmaster
* Removed gametype, fraglimit and dmflags cvars * Removed CD key authentication stuff * Implemented a means to save and restore cmd context * Bumped protocol version up to 69 (same as 68) * Removed various references to punkbuster * Maps on create server menu now sorted by name * Fixed some warnings
Diffstat (limited to 'src/master/Makefile')
-rw-r--r--src/master/Makefile52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/master/Makefile b/src/master/Makefile
new file mode 100644
index 00000000..308ebf05
--- /dev/null
+++ b/src/master/Makefile
@@ -0,0 +1,52 @@
+ARCH=$(shell uname -m | sed -e s/i.86/i386/)
+PLATFORM=$(shell uname|sed -e s/_.*//|tr A-Z a-z)
+BD_DEBUG=debug-$(ARCH)$(PLATFORM)
+BD_RELEASE=release-$(ARCH)$(PLATFORM)
+
+ifeq ($(PLATFORM),mingw32)
+ BINEXT=.exe
+ RELEASE_LDFLAGS=-lwsock32
+ DEBUG_LDFLAGS=-lwsock32
+ RM=del
+ MKDIR=md
+else
+ BINEXT=
+ RELEASE_LDFLAGS=
+ DEBUG_LDFLAGS=
+ RM=rm -f
+ MKDIR=mkdir
+endif
+
+CC=gcc
+RELEASE_CFLAGS=-Wall -O2
+DEBUG_CFLAGS=-g
+OBJECTS= \
+ $(BD)/master.o \
+ $(BD)/messages.o \
+ $(BD)/servers.o
+
+release: makedirs
+ $(MAKE) $(BD_RELEASE)/tremmaster BD=$(BD_RELEASE) \
+ CFLAGS="$(CFLAGS) $(RELEASE_CFLAGS)" LDFLAGS="$(LDFLAGS) $(RELEASE_LDFLAGS)"
+
+debug: makedirs
+ $(MAKE) $(BD_DEBUG)/tremmaster BD=$(BD_DEBUG) \
+ CFLAGS="$(CFLAGS) $(DEBUG_CFLAGS)" LDFLAGS="$(LDFLAGS) $(DEBUG_LDFLAGS)"
+
+all: release debug
+
+$(BD)/%.o: %.c
+ $(CC) $(CFLAGS) -o $@ -c $<
+
+$(BD)/tremmaster: $(OBJECTS)
+ $(CC) -o $@ $(OBJECTS) $(LDFLAGS)
+
+clean:
+ -$(RM) $(BD_DEBUG)/*
+ -$(RM) $(BD_RELEASE)/*
+
+makedirs:
+ @if [ ! -d $(BD_RELEASE) ];then $(MKDIR) $(BD_RELEASE);fi
+ @if [ ! -d $(BD_DEBUG) ];then $(MKDIR) $(BD_DEBUG);fi
+
+.PHONY: all clean