File: Makefile

package info (click to toggle)
xtend 1.1-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 320 kB
  • ctags: 145
  • sloc: ansic: 1,126; makefile: 109; perl: 102; sh: 77
file content (135 lines) | stat: -rw-r--r-- 3,699 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#
# Xtend is Copyright (C) 1998 David M. Shaw <dshaw@jabberwocky.com>
# 
#    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., 675 Mass Ave, Cambridge, MA 02139, USA.
# 
# $Id: Makefile,v 2.19 1998-04-06 01:38:13-04 dshaw Exp $

# Your C compiler

CC=gcc

# Flags to pass

FLAGS=-Wall -O3

# Where to install the program and the man page?

BINDIR=$(DESTDIR)/usr/bin
MANDIR=$(DESTDIR)/usr/man/man1

# Only uncomment ONE of the below sections!

# Linux
LOCKDIR=/var/lock
OWNER=root
GROUP=root
PERMS=2555

# BSD/OS
# LOCKDIR=/var/spool/uucp
# OWNER=root
# GROUP=uucp
# PERMS=2555

# Solaris
# LOCKDIR=/var/spool/locks
# OWNER=uucp
# GROUP=uucp
# PERMS=4555

# OpenBSD
# LOCKDIR=/var/spool/lock
# OWNER=uucp
# GROUP=uucp
# PERMS=4555

# Other
# LOCKDIR=/put/your/lock/dir/here
# OWNER=whatever
# GROUP=whatever
# PERMS=whatever

#############################################################
# You shouldn't need to change anything under here

VERSION=1.1
PREVIOUS=1
CFLAGS=$(FLAGS) -DDEFAULT_LOCKDIR=\"$(LOCKDIR)\"
DISTFILES=COPYING README INSTALL ANNOUNCE FAQ \
	*.h *.c Makefile sample-xtendrc *.1 \
	tools/xtend.pm tools/xtend.bash tools/status \
	tools/status2 tools/status.bash tools/parse-status \
	tools/README

PROGS=xtend

all: $(PROGS)
	@echo "Built $(PROGS) version $(VERSION)"
clean:
	rm -f *.o *.core core $(PROGS)

exec.o: exec.h x10.h util.h
util.o: util.h x10.h
xtend.o: util.h parse.h x10.h exec.h version.h
parse.o: parse.h x10.h
xtend:	xtend.o util.o parse.o exec.o
	$(CC) xtend.o util.o parse.o exec.o -o xtend

install: $(PROGS)
	-mv $(BINDIR)/xtend $(BINDIR)/xtend.old
	cp xtend $(BINDIR)
	chown $(OWNER).$(GROUP) $(BINDIR)/xtend
	chmod 755 $(BINDIR)/xtend
	cp xtend.1 $(MANDIR)
	chmod 444 $(MANDIR)/xtend.1

version.h: Makefile
	rm -f version.h
	echo '#define VERSION "$(VERSION)"' > version.h

diffs:  $(DISTFILES)
	rm -f diffs
	-rcsdiff -qcr$(PREVIOUS) $(DISTFILES) > diffs

dist:	xtend-$(VERSION).tar.gz LSM

MANIFEST: $(DISTFILES)
	rm -f MANIFEST
	for i in $(DISTFILES); \
	do echo xtend-$(VERSION)/$$i >> MANIFEST; done

xtend-$(VERSION).tar.gz: MANIFEST version.h
		rm -f xtend-$(VERSION).tar.gz
		(cd ..; tar -cvf - `cat xtend-$(VERSION)/MANIFEST` \
		 xtend-$(VERSION)/MANIFEST \
		 | gzip -9 > xtend-$(VERSION)/xtend-$(VERSION).tar.gz;)

LSM:	version.h xtend-$(VERSION).tar.gz
	rm -f LSM
	echo "Begin3" > LSM
	echo "Title: Xtend: The X10 to UNIX controller" >> LSM
	echo "Version: $(VERSION)" >> LSM
	echo "Entered-date: `date +%d%b%y | tr a-z A-Z`" >> LSM
	echo "Description: xtend is a daemon that is used in combination with a" >> LSM
	echo "	CM11a X10 interface that hooks to one of your serial ports." >> LSM
	echo "	It executes arbitrary shell commands depending on what X10" >> LSM
	echo "	commands it sees." >> LSM
	echo "Keywords: X10 home automation" >> LSM
	echo "Author: dshaw@jabberwocky.com (David Shaw)" >> LSM
	echo "Primary-site: ftp.jabberwocky.com /pub/xtend/" >> LSM
	echo "	`ls -s xtend-$(VERSION).tar.gz | sed 's/ *\([0-9]*\).*/\1/g'` kB xtend-$(VERSION).tar.gz" >> LSM
	echo "Copying-policy: GPL" >> LSM
	echo "End" >> LSM