summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: cc096b205682d8679dc56b307248576a1a8d8974 (plain)
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
## -----------------------------------------------------------------------
##   
##   Copyright 2005 H. Peter Anvin - All Rights Reserved
##
##   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, Inc., 675 Mass Ave, Cambridge MA 02139,
##   USA; either version 2 of the License, or (at your option) any later
##   version; incorporated herein by reference.
##
## -----------------------------------------------------------------------

##
## Makefile for attachtty
##

-include MCONFIG
include MRULES

PROGS     = attachtty
MAN1PAGES = attachtty.1

OBJS = 	attachtty.o speedcvt.o

all: $(PROGS)

spec: attachtty.spec

clean:
	rm -f *.o *.i *.s version.h $(PROGS)

distclean: clean
	rm -f MCONFIG config.status config.log config.h *~ \#*
	rm -f core *.orig *.rej
	rm -rf *.cache

release:
	$(MAKE) configure
	$(MAKE) spec
	$(MAKE) distclean

attachtty: $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

speedcvt.c: termios.c speedcvt.pl
	$(CC) $(CFLAGS) -E -dM termios.c | \
		$(PERL) speedcvt.pl speedcvt.c

spotless: distclean
	rm -f configure config.h.in zisofs-tools.spec

install: all
	mkdir -p $(INSTALLROOT)$(bindir)
	$(INSTALL_PROGRAM) $(PROGS) $(INSTALLROOT)$(bindir)
	mkdir -p $(INSTALLROOT)$(mandir)/man1
	$(INSTALL_DATA) $(MAN1PAGES) $(INSTALLROOT)$(mandir)/man1

config:	MCONFIG

MCONFIG: configure MCONFIG.in config.h.in
	./configure

config.h: MCONFIG
	: Generated by side effect

config.h.in: configure.in
	rm -f config.h.in
	autoheader

configure: configure.in aclocal.m4
	autoconf
	rm -f MCONFIG config.cache config.log config.status config.h

#
# Version header
#
VERSION = $(shell cat version)

version.h: version
	echo "#define ATTACHTTY_VERSION \"$(VERSION)\"" > version.h

attachtty.spec: attachtty.spec.in version
	sed -e 's/@@VERSION@@/$(VERSION)/g' < attachtty.spec.in > $@