-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile.in
91 lines (66 loc) · 2.25 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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)/libexec/magicrescue/tools \
$(INSTALLDIR)/share/magicrescue/recipes \
$(INSTALLDIR)/share/man/man1 \
$(INSTALLDIR)/bin
cp magicrescue$(EXE) dupemap$(EXE) magicsort $(INSTALLDIR)/bin/
cp recipes/* $(INSTALLDIR)/share/magicrescue/recipes/
cp $(DOCS) $(INSTALLDIR)/share/man/man1
for f in tools/*; do \
if [ -x "$$f" ]; then \
cp -f "$$f" $(INSTALLDIR)/libexec/magicrescue/tools/; \
fi; \
done
cp -f tools/laola.pl $(INSTALLDIR)/libexec/magicrescue/tools/
chmod 755 $(INSTALLDIR)/libexec/magicrescue/tools/laola.pl
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)/share/man/man1/`basename $$f`"; \
done
rm -rf $(INSTALLDIR)/libexec/magicrescue/
rm -rf $(INSTALLDIR)/share/magicrescue/
.PHONY: all clean distclean docs-clean maintainer-clean install uninstall docs
.SUFFIXES: .1 .pod
.POSIX: