Codebase list magicrescue / lintian-fixes/main Makefile.in
lintian-fixes/main

Tree @lintian-fixes/main (Download .tar.gz)

Makefile.in @lintian-fixes/mainraw · history · blame

SHELL = /bin/sh
PROGRAMS = magicrescue dupemap tools/inputseek tools/safecat \
	   tools/textextract
DOCS = doc/magicrescue.1 doc/dupemap.1 doc/magicsort.1

INSTALLDIR = $(DESTDIR)$(PREFIX)

# object file lists
MAGICRESCUE_OBJS = src/magicrescue.o src/array.o src/extract.o src/recipe.o \
		   src/scanner.o src/util.o

DUPEMAP_OBJS = src/dupemap.o src/recur.o

INPUTSEEK_OBJS   = tools/inputseek.o   src/util.o
SAFECAT_OBJS     = tools/safecat.o     src/util.o
TEXTEXTRACT_OBJS = tools/textextract.o src/util.o

# default target
all: $(PROGRAMS) docs

# program targets
magicrescue: $(MAGICRESCUE_OBJS)
	$(CC) -o $@ $(MAGICRESCUE_OBJS) $(LDFLAGS)

dupemap: $(DUPEMAP_OBJS)
	$(CC) -o $@ $(DUPEMAP_OBJS) $(LDFLAGS) $(DBM_LDFLAGS)
 
tools/inputseek: $(INPUTSEEK_OBJS)
	$(CC) -o $@ $(INPUTSEEK_OBJS) $(LDFLAGS)

tools/safecat: $(SAFECAT_OBJS)
	$(CC) -o $@ $(SAFECAT_OBJS) $(LDFLAGS)

tools/textextract: $(TEXTEXTRACT_OBJS)
	$(CC) -o $@ $(TEXTEXTRACT_OBJS) $(LDFLAGS)

# implicit targets
.c.o:
	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<

.pod.1:
	pod2man --release "$(RELEASE)" --center "Magic Rescue" $< $@

# phony targets
docs: $(DOCS)

clean:
	rm -f src/*.o tools/*.o

distclean: clean
	rm -f $(PROGRAMS) Makefile config.h config.log

docs-clean:
	rm -f $(DOCS)

maintainer-clean: distclean docs-clean

install: all
	mkdir -p $(INSTALLDIR)/share/magicrescue/tools \
	    $(INSTALLDIR)/share/magicrescue/recipes \
	    $(INSTALLDIR)/man/man1 \
	    $(INSTALLDIR)/bin
	
	cp magicrescue$(EXE) dupemap$(EXE) magicsort $(INSTALLDIR)/bin/
	cp recipes/* $(INSTALLDIR)/share/magicrescue/recipes/
	cp $(DOCS) $(INSTALLDIR)/man/man1
	
	for f in tools/*; do \
	  if [ -x "$$f" ]; then \
	    cp -f "$$f" $(INSTALLDIR)/share/magicrescue/tools/; \
	  fi; \
	done
	cp -f tools/laola.pl $(INSTALLDIR)/share/magicrescue/tools/

uninstall:
	rm -f $(INSTALLDIR)/bin/magicrescue$(EXE)
	rm -f $(INSTALLDIR)/bin/dupemap$(EXE)
	rm -f $(INSTALLDIR)/bin/magicsort
	for f in $(DOCS); do \
	   rm -f "$(INSTALLDIR)/man/man1/`basename $$f`"; \
	done
	rm -rf $(INSTALLDIR)/share/magicrescue/tools
	rm -rf $(INSTALLDIR)/share/magicrescue/recipes
	-rmdir $(INSTALLDIR)/share/magicrescue

.PHONY: all clean distclean docs-clean maintainer-clean install uninstall docs

.SUFFIXES: .1 .pod

.POSIX: