sammler/Makefile
2006-09-30 22:55:04 +02:00

44 lines
844 B
Makefile

# Toplevel Makefile
WITH_RRD = yes
# ############################
SAMMLER_SRC := sammler.c configfile.c logging.c network.c plugins.c
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
CFLAGS := -O2 -Wall
LDFLAGS := -ldl -rdynamic
# ############################
ifeq ("$(WITH_RRD)", "yes")
SAMMLER_SRC += rrdtool.c
CFLAGS += -DWITH_RRD
LDFLAGS += -lrrd
endif
# ############################
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 $<
%.so: %_sh.o
$(LD) -shared -o $@ $<
clean:
rm -rf *.d *.o *.so sammler
#-include $(SAMMLER_SRC:.c=.d) $(PLUGIN_SRC:.c=.d)