aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile45
1 files changed, 45 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..c9d5441
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,45 @@
+# Copyright 2019 ~ 2021 YuutaW Minecraft, All Rights Reserved.
+# Proprietary and confidential.
+# Unauthorized copying of any parts of this file, via any medium is strictly prohibited.
+# Written by Yuuta Liang <yuuta@yuuta.moe>, April 2021.
+
+CFLAGS= \
+ -I.\
+ -std=c99 \
+ -Wall \
+ -D_POSIX_C_SOURCE=200809L \
+
+
+LDFLAGS= \
+ -ldl \
+ -lpthread \
+
+
+OBJ=main.o thpool.o mcin.o plugins.o rcon_host.o rcon.o net.o plugin_registry.o threads_util.o md5.o
+
+BIN=extmc
+
+debug: CFLAGS += -DCONTROL_SOCKET_PATH="\"./extmc.ctl\"" -g3 -O0 -rdynamic
+debug: $(BIN)
+
+release: CFLAGS += -DDISABLE_DEBUG
+release: $(BIN)
+
+%.o: %.c
+ $(CC) -c -o $@ $< $(CFLAGS)
+
+$(BIN): $(OBJ)
+ $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
+
+.PHONY: clean
+clean:
+ $(RM) *~ *.o $(BIN)
+
+ifeq ($(PREFIX),)
+ PREFIX := /usr/local
+endif
+
+install: $(BIN)
+ install -d $(DESTDIR)$(PREFIX)/bin/
+ install -m 755 $(BIN) $(DESTDIR)$(PREFIX)/bin/
+ ln -s $(DESTDIR)$(PREFIX)/bin/$(BIN) $(DESTDIR)$(PREFIX)/bin/extmcctl