"Fossies" - the Fresh Open Source Software Archive 
Member "anacron-2.5.3/Makefile" (11 Jan 2008, 2769 Bytes) of package /linux/misc/old/anacron.2.5.3.tar.gz:
As a special service "Fossies" has tried to format the requested text file into HTML format (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 # Anacron - run commands periodically
2 # Copyright (C) 1998 Itai Tzur <itzur@actcom.co.il>
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #
18 # The GNU General Public License can also be found in the file
19 # `COPYING' that comes with the Anacron source distribution.
20
21
22 PREFIX =
23 BINDIR = $(PREFIX)/usr/sbin
24 MANDIR = $(PREFIX)/usr/man
25 CFLAGS = -Wall -pedantic -O2
26 #CFLAGS = -Wall -O2 -g -DDEBUG
27
28 # If you change these, please update the man-pages too
29 # Only absolute paths here, please
30 SPOOLDIR = /var/spool/anacron
31 ANACRONTAB = /etc/anacrontab
32
33 RELEASE = 2.4.3
34 package_name = anacron-$(RELEASE)
35 distfiles = ChangeLog COPYING README TODO anacron.8 anacrontab.5 anacrontab Makefile *.h *.c
36
37 SHELL = /bin/sh
38 INSTALL = install
39 INSTALL_PROGRAM = $(INSTALL)
40 INSTALL_DATA = $(INSTALL)
41 INSTALL_DIR = $(INSTALL) -d
42 GZIP = gzip -9 -f
43 ALL_CPPFLAGS = -DSPOOLDIR=\"$(SPOOLDIR)\" -DRELEASE=\"$(RELEASE)\" \
44 -DANACRONTAB=\"$(ANACRONTAB)\" $(CPPFLAGS)
45
46 csources := $(wildcard *.c)
47 objects = $(csources:.c=.o)
48
49 .PHONY: all
50 all: anacron
51
52 # This makefile generates header file dependencies auto-magically
53 %.d: %.c
54 $(SHELL) -ec "$(CC) -MM $(ALL_CPPFLAGS) $< \
55 | sed '1s/^\(.*\)\.o[ :]*/\1.d &/1' > $@"
56
57 include $(csources:.c=.d)
58
59 anacron: $(objects)
60 $(CC) $(LDFLAGS) $^ $(LOADLIBES) -o $@
61
62 %.o : %.c
63 $(CC) -c $(ALL_CPPFLAGS) $(CFLAGS) $< -o $@
64
65 .PHONY: installdirs
66 installdirs:
67 $(INSTALL_DIR) $(BINDIR) $(PREFIX)$(SPOOLDIR) \
68 $(MANDIR)/man5 $(MANDIR)/man8
69
70 .PHONY: install
71 install: installdirs
72 $(INSTALL_PROGRAM) anacron $(BINDIR)/anacron
73 $(INSTALL_DATA) anacrontab.5 $(MANDIR)/man5/anacrontab.5
74 $(INSTALL_DATA) anacron.8 $(MANDIR)/man8/anacron.8
75 $(INSTALL_DATA) anacrontab $(ANACRONTAB)
76
77 .PHONY: clean
78 clean:
79 rm -f *.o *.d anacron
80
81 distclean: clean
82 rm -f *~
83
84 .PHONY: dist
85 dist: $(package_name).tar.gz
86
87 $(package_name).tar.gz: $(distfiles)
88 mkdir $(package_name)
89 ln $(distfiles) $(package_name)
90 chmod 0644 $(package_name)/*
91 chmod 0755 $(package_name)
92 tar cf $(package_name).tar $(package_name)
93 $(GZIP) $(package_name).tar
94 rm -r $(package_name)
95
96 release: distclean $(package_name).tar.gz