different name when compiled without rrd support
This commit is contained in:
parent
a68116f30c
commit
065505d8ab
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,5 +2,6 @@
|
|||||||
*.so
|
*.so
|
||||||
*.d
|
*.d
|
||||||
sammler
|
sammler
|
||||||
|
sammler_norrd
|
||||||
sammler.log
|
sammler.log
|
||||||
rrd
|
rrd
|
||||||
|
15
Makefile
15
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
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user