sammler/Makefile

40 lines
784 B
Makefile

# Toplevel Makefile
WITH_RRD=yes
PLUGINS := ctstat load memory mount netdev random rtstat stat uptime vmstat
PLUGINS += apache mysql
# ############################
SAMMLER_SRC := sammler.c configfile.c event.c helper.c logging.c network.c plugins.c probe.c
CFLAGS := -O2 -Wall -fno-stack-protector -Iinclude
LDFLAGS := -ldl -rdynamic
# ############################
ifeq ("$(WITH_RRD)", "yes")
SAMMLER_SRC += rrdtool.c
CFLAGS += -DWITH_RRD
LDFLAGS += -lrrd
endif
# ############################
all: sammler
make -C plugins PLUGINS="$(PLUGINS)"
sammler: $(SAMMLER_SRC:%.c=%.o)
$(CC) $(LDFLAGS) $^ -o $@
%.d: %.c
$(CC) $(CFLAGS) -MM -c $< -o $@
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
clean:
rm -rf *.d *.o sammler
make -C plugins clean
-include $(SAMMLER_SRC:%.c=%.d)