# Things we build and install BIN_FILES=swabber load_distro swabprof swab_testf # Scripts we install SCRIPTS=update_distro detect_distro ALL_INSTALL=$(BIN_FILES) $(SCRIPTS) # Things we build but don't install BIN_OTHER=dump_blob canonicalize FILTER_FILES=distros # Installation directories bindir = /usr/bin filterdir= /usr/share/swabber swabber_SRC=swabber.c lists.c wandering.c canonicalize.c swabber_OBJ=$(patsubst %.c,%.o,$(swabber_SRC)) CFLAGS=-Wall -g all: ${BIN_FILES} ${BIN_OTHER} # Header file dependencies dump_blob load_distro $(swabber_OBJ): packages.h lists.o swabber.o: lists.h swabber.o wandering.o: wandering.h swabber.o wandering.o: swabber.h canonicalize swabber.o: canonicalize.h load_distro swab_testf dump_blob: %: %.c ${CC} ${CFLAGS} -o $@ $< canonicalize: %: %.c ${CC} ${CFLAGS} -DTEST_PROGRAM -o $@ $< swabber: ${swabber_OBJ} ${CC} ${CFLAGS} -o $@ ${swabber_OBJ} swabprof: swabprof.in sed -e 's![@]filtersdir[@]!$(DESTDIR)$(filterdir)!g' \ swabprof.in > $@ chmod 755 $@ .PHONY : clean install uninstall clean: rm -f ${BIN_FILES} ${BIN_OTHER} *.o install: all mkdir -p $(DESTDIR)$(filterdir) cp -a ${FILTER_FILES} $(DESTDIR)$(filterdir) mkdir -p $(DESTDIR)$(bindir) install $(ALL_INSTALL) $(DESTDIR)$(bindir) uninstall: for filename in $(ALL_INSTALL) ; do \ rm -f $(DESTDIR)$(bindir)/$${filename} ; \ done