dedup

deduplicating backup program
git clone git://git.2f30.org/dedup.git
Log | Files | Refs | README | LICENSE

Makefile (2168B)


      1 include config.mk
      2 
      3 BIN = dup-check dup-gc dup-init dup-keygen dup-pack dup-rm dup-unpack
      4 MAN = dup-check.1 dup-gc.1 dup-init.1 dup-keygen.1 dup-pack.1 dup-rm.1 dup-unpack.1
      5 
      6 HDR = \
      7         arg.h \
      8         block.h \
      9         chunker.h \
     10         compat.h \
     11         config.h \
     12         key.h \
     13         lock.h \
     14         misc.h \
     15         queue.h \
     16         snap.h \
     17         state.h \
     18         tree.h \
     19 
     20 COMMOBJ = \
     21         bcompress.o \
     22         bencrypt.o \
     23         block.o \
     24         bstorage.o \
     25         chunker.o \
     26         compat.o \
     27         key.o \
     28         lock.o \
     29         misc.o \
     30         pack.o \
     31         snap.o \
     32         state.o \
     33         unpack.o \
     34 
     35 DCHECKOBJ = $(COMMOBJ) dup-check.o
     36 DGCOBJ = $(COMMOBJ) dup-gc.o
     37 DINITOBJ = $(COMMOBJ) dup-init.o
     38 DKEYGENOBJ = $(COMMOBJ) dup-keygen.o
     39 DPACKOBJ = $(COMMOBJ) dup-pack.o
     40 DRMOBJ = $(COMMOBJ) dup-rm.o
     41 DUNPACKOBJ = $(COMMOBJ) dup-unpack.o
     42 
     43 LDLIBS = -lsnappy -llz4 -lsodium
     44 
     45 all: $(BIN)
     46 
     47 $(DCHECKOBJ) $(DGCOBJ) $(DINITOBJ) $(DKEYGENOBJ) $(DPACKOBJ) $(DRMOBJ) $(DUNPACKOBJ): $(HDR)
     48 
     49 clean:
     50 	rm -f $(DCHECKOBJ) $(DGCOBJ) $(DINITOBJ) $(DKEYGENOBJ) $(DPACKOBJ) $(DRMOBJ) $(DUNPACKOBJ) $(BIN)
     51 	rm -rf dedup-$(VERSION) dedup-$(VERSION).tar.gz
     52 
     53 install: all
     54 	mkdir -p $(DESTDIR)$(PREFIX)/bin
     55 	cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
     56 	mkdir -p $(DESTDIR)$(MANPREFIX)/man1
     57 	cp -f $(MAN) $(DESTDIR)$(MANPREFIX)/man1
     58 
     59 uninstall:
     60 	cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN)
     61 	cd $(DESTDIR)$(MANPREFIX)/man1 && rm -f $(MAN)
     62 
     63 dist: clean
     64 	mkdir -p dedup-$(VERSION)
     65 	cp `find . -maxdepth 1 -type f` dedup-$(VERSION)
     66 	tar -c dedup-$(VERSION) | gzip > dedup-$(VERSION).tar.gz
     67 
     68 test: all
     69 	sh runtests
     70 
     71 .SUFFIXES: .c .o
     72 
     73 .c.o:
     74 	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
     75 
     76 dup-check: $(DCHECKOBJ)
     77 	$(CC) -o $@ $(DCHECKOBJ) $(LDFLAGS) $(LDLIBS)
     78 
     79 dup-gc: $(DGCOBJ)
     80 	$(CC) -o $@ $(DGCOBJ) $(LDFLAGS) $(LDLIBS)
     81 
     82 dup-init: $(DINITOBJ)
     83 	$(CC) -o $@ $(DINITOBJ) $(LDFLAGS) $(LDLIBS)
     84 
     85 dup-keygen: $(DKEYGENOBJ)
     86 	$(CC) -o $@ $(DKEYGENOBJ) $(LDFLAGS) $(LDLIBS)
     87 
     88 dup-pack: $(DPACKOBJ)
     89 	$(CC) -o $@ $(DPACKOBJ) $(LDFLAGS) $(LDLIBS)
     90 
     91 dup-rm: $(DRMOBJ)
     92 	$(CC) -o $@ $(DRMOBJ) $(LDFLAGS) $(LDLIBS)
     93 
     94 dup-unpack: $(DUNPACKOBJ)
     95 	$(CC) -o $@ $(DUNPACKOBJ) $(LDFLAGS) $(LDLIBS)