File: Makefile

package info (click to toggle)
faubackup 0.5pre1-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 252 kB
  • ctags: 69
  • sloc: ansic: 808; perl: 402; makefile: 93; sh: 3
file content (100 lines) | stat: -rw-r--r-- 2,717 bytes parent folder | download
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
91
92
93
94
95
96
97
98
99
100
#   FauBackup - Backup System, using a Filesystem for Storage
#   Copyright (C) 2000-2002 Martin Waitz, Dr. Volkmar Sieh
#   $Id: Makefile,v 1.11 2001/03/10 16:03:41 mnwaitz Exp $
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


prefix=/usr/local

 #       #
###########
VERSION=0.5
###########
 #       #

BUILD=./=build
CC=gcc
CFLAGS+=-Wall

PROGS=$(BUILD)/faubackup $(BUILD)/faubackup-find $(BUILD)/faubackup-gather $(BUILD)/faubackup-scatter

all: build



#
# Building
#

build: $(BUILD) $(PROGS)

$(BUILD):
	mkdir $@


#
# Installation
#

install: build
	mkdir -p $(DESTDIR)/etc
	mkdir -p $(DESTDIR)$(prefix)/sbin
	mkdir -p $(DESTDIR)$(prefix)/share/man/man5
	mkdir -p $(DESTDIR)$(prefix)/share/man/man8
	for f in $(PROGS) ; do \
		install -m 755 $$f $(DESTDIR)$(prefix)/sbin/ ;\
	done
	cp -p faubackup.8 $(DESTDIR)$(prefix)/share/man/man8/
	cp -p faubackup-find.8 $(DESTDIR)$(prefix)/share/man/man8/
	cp -p faubackup-gather.8 $(DESTDIR)$(prefix)/share/man/man8/
	ln -s faubackup-gather.8 $(DESTDIR)$(prefix)/share/man/man8/faubackup-scatter.8
	cp -p faubackup.conf $(DESTDIR)/etc/
	cp -p faubackup.conf.5 $(DESTDIR)$(prefix)/share/man/man5/
uninstall:
	rm -f $(DESTDIR)/etc/faubackup.conf
	rm -f $(DESTDIR)$(prefix)/sbin/faubackup
	rm -f $(DESTDIR)$(prefix)/sbin/faubackup-find
	rm -f $(DESTDIR)$(prefix)/sbin/faubackup-gather
	rm -f $(DESTDIR)$(prefix)/sbin/faubackup-scatter
	rm -f $(DESTDIR)$(prefix)/share/man/man5/faubackup.conf.5
	rm -f $(DESTDIR)$(prefix)/share/man/man8/faubackup.8
	rm -f $(DESTDIR)$(prefix)/share/man/man8/faubackup-gather.8
	rm -f $(DESTDIR)$(prefix)/share/man/man8/faubackup-scatter.8


#############################################################################
#
# Rules:
#


clean:
	rm -rf $(BUILD)/

# Build Perl scripts
$(BUILD)/% : %.pl
	perl -c $<
	echo "#!`which perl` -w" > $@
	sed -e 's/@VERSION@/$(VERSION)/g' $< >> $@
	chmod +x $@

# Build C programs
$(BUILD)/%.o : %.c faubackup.h
	$(CC) -o $@ $(CFLAGS) $<
$(BUILD)/% : $(BUILD)/%.o
	$(LD) -o $@ $(LDFLAGS) $<

.PHONY: all clean dist-clean