aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-09 13:35:03 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-09 13:35:03 +0100
commit95be538a932ad869332264be0633d17f34e11ccd (patch)
tree2569a68ba8c9da12ab5720d71898308e75435924
parent2778ba9a7ce04503a0a4dc4f542d3979827ea874 (diff)
Added new makefiles
-rw-r--r--FICS/build.mk42
-rw-r--r--GNUmakefile19
-rw-r--r--common.mk8
-rw-r--r--maketargets/clean.mk6
-rw-r--r--options.mk17
-rw-r--r--vars.mk5
6 files changed, 97 insertions, 0 deletions
diff --git a/FICS/build.mk b/FICS/build.mk
new file mode 100644
index 0000000..2339655
--- /dev/null
+++ b/FICS/build.mk
@@ -0,0 +1,42 @@
+# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net>
+# SPDX-License-Identifier: ISC
+
+SRC_DIR := FICS/
+
+OBJS = $(SRC_DIR)adminproc.o\
+ $(SRC_DIR)algcheck.o\
+ $(SRC_DIR)board.o\
+ $(SRC_DIR)channel.o\
+ $(SRC_DIR)command.o\
+ $(SRC_DIR)comproc.o\
+ $(SRC_DIR)eco.o\
+ $(SRC_DIR)ficsmain.o\
+ $(SRC_DIR)formula.o\
+ $(SRC_DIR)gamedb.o\
+ $(SRC_DIR)gameproc.o\
+ $(SRC_DIR)get_tcp_conn.o\
+ $(SRC_DIR)legal.o\
+ $(SRC_DIR)lists.o\
+ $(SRC_DIR)matchproc.o\
+ $(SRC_DIR)movecheck.o\
+ $(SRC_DIR)multicol.o\
+ $(SRC_DIR)network.o\
+ $(SRC_DIR)obsproc.o\
+ $(SRC_DIR)playerdb.o\
+ $(SRC_DIR)rating_conv.o\
+ $(SRC_DIR)ratings.o\
+ $(SRC_DIR)rmalloc.o\
+ $(SRC_DIR)shutdown.o\
+ $(SRC_DIR)talkproc.o\
+ $(SRC_DIR)utils.o\
+ $(SRC_DIR)variable.o\
+ $(SRC_DIR)vers.o
+# dfree
+# fics_addplayer
+# makerank
+# memmove
+
+fics: $(OBJS)
+ $(E) " LINK " $@
+ $(Q) $(CXX) $(CXXFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
+# EOF
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..96c3795
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,19 @@
+# Makefile for use with GNU make
+# SPDX-FileCopyrightText: 2023 Markus Uhlin <maxxe@rpblc.net>
+# SPDX-License-Identifier: ISC
+
+include options.mk
+
+# common vars
+include vars.mk
+
+all: $(TGTS)
+
+include FICS/build.mk
+
+# common rules
+include common.mk
+
+.PHONY: clean
+
+include $(TARGETS_DIR)clean.mk
diff --git a/common.mk b/common.mk
new file mode 100644
index 0000000..70243c5
--- /dev/null
+++ b/common.mk
@@ -0,0 +1,8 @@
+# common.mk -- common rules
+
+.c.o:
+ $(E) " CC " $@
+ $(Q) $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+.cpp.o:
+ $(E) " CXX " $@
+ $(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
diff --git a/maketargets/clean.mk b/maketargets/clean.mk
new file mode 100644
index 0000000..a7845cb
--- /dev/null
+++ b/maketargets/clean.mk
@@ -0,0 +1,6 @@
+# The 'clean' target
+
+clean:
+ $(E) " CLEAN"
+ $(RM) $(OBJS)
+ $(RM) $(TGTS)
diff --git a/options.mk b/options.mk
new file mode 100644
index 0000000..51bd7ff
--- /dev/null
+++ b/options.mk
@@ -0,0 +1,17 @@
+# options.mk
+
+CC ?= cc
+CFLAGS = -O2 -Wall -pipe -std=c11
+
+CXX ?= c++
+CXXFLAGS = -std=c++17
+
+# C preprocessor flags
+CPPFLAGS = -D_DEFAULT_SOURCE=1
+
+LDFLAGS =
+LDLIBS = -lcrypt
+RM ?= @rm -f
+
+E = @echo
+Q = @
diff --git a/vars.mk b/vars.mk
new file mode 100644
index 0000000..109d178
--- /dev/null
+++ b/vars.mk
@@ -0,0 +1,5 @@
+# vars.mk -- common vars
+
+ROOT := ./
+TARGETS_DIR := $(ROOT)maketargets/
+TGTS = fics