aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-05-12 03:18:19 +0200
committerMattias Andrée <maandree@operamail.com>2014-05-12 03:18:19 +0200
commite58e5a6299a7d86896fe7925edebab6120625137 (patch)
treed1e532b5459323ddc9c541b0197659cc2779b8f8 /Makefile
parentm + fix errors in mds.c (diff)
downloadmds-e58e5a6299a7d86896fe7925edebab6120625137.tar.gz
mds-e58e5a6299a7d86896fe7925edebab6120625137.tar.bz2
mds-e58e5a6299a7d86896fe7925edebab6120625137.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 16 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 2d8891d..62a2c98 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ INFODIR ?= $(DATADIR)/info
LICENSEDIR ?= $(DATADIR)/licenses
# The name of the package as it should be installed.
-PKGNAME ?= blueshift
+PKGNAME ?= mds
# Optimisation level (and debug flags.)
@@ -52,11 +52,21 @@ WARN = -Wall -Wextra -pedantic -Wdouble-promotion -Wformat=2 -Winit-self \
# The C standard used in the code.
STD = gnu99
+# Libraries linking flags.
+LDS = -pthread -Lbin -lmdsserver -lrt
+
+# C compiler debug flags.
+DEBUG_FLAGS =
+ifeq ($(DEBUG),y)
+DEBUG_FLAGS += -D'DEBUG'
+DEBUG_FLAGS += -D'LIBEXECDIR="$(shell pwd)/bin/"'
+endif
+
# Options for the C compiler.
C_FLAGS = $(OPTIMISE) $(WARN) -std=$(STD) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) \
-ftree-vrp -fstrict-aliasing -fipa-pure-const -fstack-usage \
-fstrict-overflow -funsafe-loop-optimizations -fno-builtin \
- -D_GNU_SOURCE -pthread
+ -D'_GNU_SOURCE' -D'PKGNAME="$(PKGNAME)"' $(DEBUG_FLAGS)
# Object files for the libary
@@ -66,18 +76,18 @@ LIBOBJ = linked-list hash-table fd-table mds-message util
# Build rules.
.PHONY: all
-all: bin/mds bin/mds-server/mds-server bin/libmdsserver.so
+all: bin/mds bin/mds-server bin/libmdsserver.so
MDS_SERVER_OBJ = mds-server/mds-server mds-server/interception_condition mds-server/client \
mds-server/multicast mds-server/queued_interception
-bin/mds-server/mds-server: $(foreach O,$(MDS_SERVER_OBJ),obj/$(O).o) bin/libmdsserver.so
+bin/mds-server: $(foreach O,$(MDS_SERVER_OBJ),obj/$(O).o) bin/libmdsserver.so
mkdir -p $(shell dirname $@)
- $(CC) $(C_FLAGS) -o $@ -Lbin -lmdsserver -lrt $(foreach O,$(MDS_SERVER_OBJ),obj/$(O).o)
+ $(CC) $(C_FLAGS) -o $@ $(LDS) $(foreach O,$(MDS_SERVER_OBJ),obj/$(O).o)
bin/%: obj/%.o bin/libmdsserver.so
mkdir -p $(shell dirname $@)
- $(CC) $(C_FLAGS) -o $@ -Lbin -lmdsserver -lrt obj/$*.o
+ $(CC) $(C_FLAGS) -o $@ $(LDS) obj/$*.o
obj/mds-server/%.o: src/mds-server/%.c src/mds-server/*.h src/libmdsserver/*.h
mkdir -p $(shell dirname $@)