diff options
-rw-r--r-- | FICS/build.mk | 42 | ||||
-rw-r--r-- | GNUmakefile | 19 | ||||
-rw-r--r-- | common.mk | 8 | ||||
-rw-r--r-- | maketargets/clean.mk | 6 | ||||
-rw-r--r-- | options.mk | 17 | ||||
-rw-r--r-- | vars.mk | 5 |
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 = @ @@ -0,0 +1,5 @@ +# vars.mk -- common vars + +ROOT := ./ +TARGETS_DIR := $(ROOT)maketargets/ +TGTS = fics |