2023-04-11 10:33:36 +00:00
|
|
|
# Compiler and linker flags needed to link to the needed libraries:
|
2023-03-25 21:38:00 +00:00
|
|
|
CFLAGS = `pkg-config --cflags guile-3.0`
|
2023-04-11 10:33:36 +00:00
|
|
|
LDFLAGS= -lpthread -lncurses -lgnutls `pkg-config --libs guile-3.0`
|
|
|
|
|
|
|
|
# Files needed to compile the client:
|
|
|
|
clientsrc = $(wildcard src/*.c) src/client/SilverMUDClient.c
|
|
|
|
clientobj = $(clientsrc:.c=.o)
|
|
|
|
|
|
|
|
# Files needed to compile the server:
|
|
|
|
serversrc = $(wildcard src/*.c) src/server/SilverMUDServer.c
|
|
|
|
serverobj = $(serversrc:.c=.o)
|
|
|
|
|
|
|
|
# Default target: Compile the client and server with aggressive optimizations and a big stack of warnings:
|
|
|
|
all: CFLAGS += -Wall -Wextra -Ofast
|
2023-04-11 13:41:44 +00:00
|
|
|
all: SilverMUDClient SilverMUDServer
|
|
|
|
|
2023-04-11 10:33:36 +00:00
|
|
|
|
|
|
|
# Debug target: Compile the client and server with profiling, debug information, debug optimization, and the
|
|
|
|
# preprocessor flag "debug" set.
|
|
|
|
debug: CFLAGS += -Wall -Wextra -pg -ggdb -Og -D debug
|
2023-04-11 13:41:44 +00:00
|
|
|
debug: SilverMUDClientDebug SilverMUDServerDebug
|
2023-04-11 10:33:36 +00:00
|
|
|
|
2021-08-15 18:42:37 +00:00
|
|
|
SilverMUDClient: $(clientobj)
|
2023-04-11 10:33:36 +00:00
|
|
|
cc $^ $(LDFLAGS) -o $@
|
2021-08-15 18:42:37 +00:00
|
|
|
|
|
|
|
SilverMUDServer: $(serverobj)
|
2023-04-11 10:33:36 +00:00
|
|
|
cc $^ $(LDFLAGS) -o $@
|
2021-11-04 23:14:47 +00:00
|
|
|
|
|
|
|
SilverMUDClientDebug: $(clientobj)
|
2023-04-11 10:33:36 +00:00
|
|
|
cc -pg $^ $(LDFLAGS) -o $@
|
2021-11-04 23:14:47 +00:00
|
|
|
|
|
|
|
SilverMUDServerDebug: $(serverobj)
|
2023-04-13 01:26:12 +00:00
|
|
|
cc -pg $^ $(LDFLAGS) -o $@
|
2021-08-15 18:42:37 +00:00
|
|
|
|
2023-04-11 10:33:36 +00:00
|
|
|
# Start from a clean slate:
|
2021-08-15 18:42:37 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2023-04-11 10:33:36 +00:00
|
|
|
rm -f $(clientobj) $(serverobj) SilverMUDClient SilverMUDServer SilverMUDClientDebug SilverMUDServerDebug gmon.out
|
2021-08-15 18:42:37 +00:00
|
|
|
|