sammler/Makefile

62 lines
1.2 KiB
Makefile
Raw Normal View History

2006-06-13 21:34:36 +02:00
# Toplevel Makefile
2006-09-30 22:55:04 +02:00
WITH_RRD = yes
2006-10-08 01:58:01 +02:00
WITH_MYSQL = yes
2006-10-08 18:05:47 +02:00
WITH_CURL = yes
2006-09-30 22:55:04 +02:00
# ############################
2007-04-01 14:30:05 +02:00
SAMMLER_SRC := sammler.c configfile.c event.c helper.c logging.c network.c plugins.c probe.c
2006-09-30 22:55:04 +02:00
PLUGIN_SRC := p_ctstat.c p_load.c p_memory.c p_mount.c p_netdev.c p_random.c
PLUGIN_SRC += p_rtstat.c p_stat.c p_uptime.c p_vmstat.c
2007-04-01 01:32:59 +02:00
CFLAGS := -O2 -Wall -fno-stack-protector
2006-09-30 22:55:04 +02:00
LDFLAGS := -ldl -rdynamic
# ############################
ifeq ("$(WITH_RRD)", "yes")
2006-10-08 01:58:01 +02:00
SAMMLER_SRC += rrdtool.c
CFLAGS += -DWITH_RRD
LDFLAGS += -lrrd
endif
ifeq ("$(WITH_MYSQL)", "yes")
PLUGIN_SRC += p_mysql.c
2006-09-30 22:55:04 +02:00
endif
2006-06-13 21:34:36 +02:00
2006-10-08 18:05:47 +02:00
ifeq ("$(WITH_CURL)", "yes")
PLUGIN_SRC += p_apache.c
endif
2006-06-13 21:34:36 +02:00
# ############################
all: sammler $(PLUGIN_SRC:%.c=%.so)
sammler: $(SAMMLER_SRC:%.c=%.o)
$(CC) $(LDFLAGS) $^ -o $@
%.d: %.c
$(CC) $(CFLAGS) -MM -c $< -o $@
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
%_sh.o: %.c
$(CC) $(CFLAGS) -fPIC -o $@ -c $<
2006-10-08 18:05:47 +02:00
p_apache.so: p_apache_sh.o
$(LD) -shared -lcurl -o $@ $^
2006-10-08 01:58:01 +02:00
p_mysql.so: p_mysql_sh.o p_mysql_helper_sh.o
$(LD) -shared -lmysqlclient -o $@ $^
2006-06-13 21:34:36 +02:00
%.so: %_sh.o
$(LD) -shared -o $@ $<
clean:
rm -rf *.d *.o *.so sammler
2007-03-31 23:21:31 +02:00
-include $(SAMMLER_SRC:.c=.d) $(PLUGIN_SRC:.c=.d)