From 065505d8ab46709b9e3d0777e975b7619dcfe40a Mon Sep 17 00:00:00 2001 From: Olaf Rempel Date: Sun, 11 Jan 2009 23:21:42 +0100 Subject: [PATCH] different name when compiled without rrd support --- .gitignore | 1 + Makefile | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index be2949c..f5da82d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ *.so *.d sammler +sammler_norrd sammler.log rrd diff --git a/Makefile b/Makefile index 714cdea..c3ce706 100644 --- a/Makefile +++ b/Makefile @@ -16,23 +16,26 @@ WWW_OWNER = www-data # ############################ -SAMMLER_SRC := sammler.c configfile.c event.c helper.c logging.c network.c plugins.c probe.c +SRC := sammler.c configfile.c event.c helper.c logging.c network.c plugins.c probe.c CFLAGS := -O2 -Wall -MMD -fno-stack-protector -Iinclude LDFLAGS := -ldl -rdynamic # ############################ ifeq ("$(WITH_RRD)", "yes") - SAMMLER_SRC += rrdtool.c + SRC += rrdtool.c CFLAGS += -DWITH_RRD LDFLAGS += -lrrd + TARGET = sammler +else + TARGET = sammler_norrd endif # ############################ -all: sammler plugins +all: $(TARGET) plugins -sammler: $(SAMMLER_SRC:%.c=%.o) +$(TARGET): $(SRC:%.c=%.o) @echo " Linking file: $@" @$(CC) $(LDFLAGS) $^ -o $@ @@ -60,7 +63,7 @@ plugins/mysql.so: plugins/mysql.o plugins/mysql_helper.o @$(CC) $(LDFLAGS) -shared -o -lmysqlclient -o $@ $< install: all - install -D -m 755 -s sammler $(DESTDIR)$(BINARY_DIR)/sammler + install -D -m 755 -s $(TARGET) $(DESTDIR)$(BINARY_DIR)/$(TARGET) install -D -m 644 sammler.conf $(DESTDIR)$(CONFIG_DIR)/sammler.conf sed -i -e "s:^logfile .*$$:logfile $(LOG_DIR)/sammler.log:" \ -e "s:^rrd_dir .*$$:rrd_dir $(DATA_DIR):" \ @@ -83,6 +86,6 @@ else endif clean: - rm -rf *.d plugins/*.d *.o plugins/*.o plugins/*.so sammler + rm -rf *.d plugins/*.d *.o plugins/*.o plugins/*.so $(TARGET) include $(shell find . -name \*.d 2> /dev/null)