different name when compiled without rrd support

This commit is contained in:
Olaf Rempel 2009-01-11 23:21:42 +01:00
parent a68116f30c
commit 065505d8ab
2 changed files with 10 additions and 6 deletions

1
.gitignore vendored
View File

@ -2,5 +2,6 @@
*.so *.so
*.d *.d
sammler sammler
sammler_norrd
sammler.log sammler.log
rrd rrd

View File

@ -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 CFLAGS := -O2 -Wall -MMD -fno-stack-protector -Iinclude
LDFLAGS := -ldl -rdynamic LDFLAGS := -ldl -rdynamic
# ############################ # ############################
ifeq ("$(WITH_RRD)", "yes") ifeq ("$(WITH_RRD)", "yes")
SAMMLER_SRC += rrdtool.c SRC += rrdtool.c
CFLAGS += -DWITH_RRD CFLAGS += -DWITH_RRD
LDFLAGS += -lrrd LDFLAGS += -lrrd
TARGET = sammler
else
TARGET = sammler_norrd
endif endif
# ############################ # ############################
all: sammler plugins all: $(TARGET) plugins
sammler: $(SAMMLER_SRC:%.c=%.o) $(TARGET): $(SRC:%.c=%.o)
@echo " Linking file: $@" @echo " Linking file: $@"
@$(CC) $(LDFLAGS) $^ -o $@ @$(CC) $(LDFLAGS) $^ -o $@
@ -60,7 +63,7 @@ plugins/mysql.so: plugins/mysql.o plugins/mysql_helper.o
@$(CC) $(LDFLAGS) -shared -o -lmysqlclient -o $@ $< @$(CC) $(LDFLAGS) -shared -o -lmysqlclient -o $@ $<
install: all 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 install -D -m 644 sammler.conf $(DESTDIR)$(CONFIG_DIR)/sammler.conf
sed -i -e "s:^logfile .*$$:logfile $(LOG_DIR)/sammler.log:" \ sed -i -e "s:^logfile .*$$:logfile $(LOG_DIR)/sammler.log:" \
-e "s:^rrd_dir .*$$:rrd_dir $(DATA_DIR):" \ -e "s:^rrd_dir .*$$:rrd_dir $(DATA_DIR):" \
@ -83,6 +86,6 @@ else
endif endif
clean: 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) include $(shell find . -name \*.d 2> /dev/null)