sammler/Makefile
2006-06-13 21:34:36 +02:00

31 lines
556 B
Makefile

# Toplevel Makefile
SAMMLER_SRC := sammler.c config.c logging.c rrdtool.c plugins.c
PLUGIN_SRC := $(wildcard p_*.c)
CFLAGS := -O2 -Wall
LDFLAGS := -ldl -lrrd -rdynamic
# ############################
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)