Browse Source

different name when compiled without rrd support

master
Olaf Rempel 12 years ago
parent
commit
065505d8ab
2 changed files with 10 additions and 6 deletions
  1. +1
    -0
      .gitignore
  2. +9
    -6
      Makefile

+ 1
- 0
.gitignore View File

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

+ 9
- 6
Makefile 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
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)

Loading…
Cancel
Save