aboutsummaryrefslogtreecommitdiff
path: root/Makefile.in
blob: 08ce3904d20364a4863ffe8734ff405c70be1f5c (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
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
prefix          = @prefix@
exec_prefix     = @exec_prefix@
srcdir          = @srcdir@
BINDIR		= @bindir@
LIBDIR		= @libdir@
MANDIR		= @mandir@
INCLUDEDIR	= @includedir@

@SET_MAKE@

RM              = rm -f
LN_S            = @LN_S@
RANLIB          = @RANLIB@
INSTALL         = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA    = @INSTALL_DATA@
SHELL           = /bin/sh

NAME		= compface
UNNAME		= uncompface
EXEEXT		= @EXEEXT@
NAMEEXE		= $(NAME)$(EXEEXT)
UNNAMEEXE	= $(UNNAME)$(EXEEXT)
EXECUTABLE	= $(BINDIR)/$(NAMEEXE)
UNEXECUTABLE	= $(BINDIR)/$(UNNAMEEXE)
LIBNAME		= lib$(NAME).a
LIBRARY		= $(LIBDIR)/$(LIBNAME)
MAN1DIR		= $(MANDIR)/man1
MAN3DIR		= $(MANDIR)/man3
OBJECTS		= arith.o file.o compress.o gen.o uncompface.o
SOURCES		= compface.c uncompface.c arith.c file.c compress.c gen.c \
		  cmain.c uncmain.c version.c
INSTALLHEADERS  = compface.h
HDRS		= $(INSTALLHEADERS) data.h compface_private.h
OTHERS		= README $(NAME).1 $(NAME).3 Makefile.in Makefile.Ashton \
		  configure configure.in install-sh mkinstalldirs ChangeLog

DISTFILES       =  $(OTHERS) $(HDRS) $(SOURCES)

CC		= @CC@
CFLAGS		= @CFLAGS@
DEFS		= @DEFS@ -DHAVE_CONFIG_H
LDFLAGS		= @LDFLAGS@
LIBS		= @LIBS@

all:		$(NAMEEXE) $(UNNAMEEXE)

$(NAMEEXE) :	cmain.o compface.o $(LIBNAME)
		$(CC) $(LDFLAGS) -o $@ cmain.o compface.o $(LIBNAME)

$(UNNAMEEXE) :	uncmain.o $(LIBNAME)
		$(CC) $(LDFLAGS) -o $@ uncmain.o $(LIBNAME)

$(LIBNAME) :	$(OBJECTS)
		ar rc $(LIBNAME) $(OBJECTS)
		-$(RANLIB) $(LIBNAME)

lint :
		lint -abchx $(SOURCES)

clean :
		-rm -f *.o *.a *.sh core a.out $(NAMEEXE) $(UNNAMEEXE)

distclean: clean
		-rm -rf *~
		-rm -f config.log config.status config.cache Makefile

dist: $(DISTFILES)
		echo compface-`sed -e '/version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
		$(RM) -rf `cat .fname`
		mkdir `cat .fname`
		ln $(DISTFILES) `cat .fname`
		tar chzf `cat .fname`.tar.gz `cat .fname`
		$(RM) -rf `cat .fname` .fname

install: 	$(NAMEEXE) $(UNNAMEEXE) $(LIBNAME)
		$(INSTALL_PROGRAM) -d $(BINDIR) $(LIBDIR) $(MAN1DIR) $(MAN3DIR) $(INCLUDEDIR)
		$(INSTALL_PROGRAM) $(srcdir)/$(NAMEEXE) $(EXECUTABLE) 
		-chmod 0755 $(EXECUTABLE)
		-strip $(EXECUTABLE)
		$(INSTALL_PROGRAM) $(srcdir)/$(UNNAMEEXE) $(UNEXECUTABLE)
		-chmod 0755 $(UNEXECUTABLE)
		-strip $(UNEXECUTABLE)
		$(INSTALL_DATA) $(srcdir)/$(NAME).1 $(MAN1DIR)/$(NAME).1
		cd $(MAN1DIR) && $(RM) ./$(UNNAME).1 && $(LN_S) $(NAME).1 $(UNNAME).1
		$(INSTALL_DATA) $(srcdir)/$(NAME).3 $(MAN3DIR)/$(NAME).3
		cd $(MAN3DIR) && $(RM) ./$(UNNAME).3 && $(LN_S) $(NAME).3 $(UNNAME).3
		for hdr in $(INSTALLHEADERS); do $(INSTALL_DATA) $(srcdir)/$${hdr} $(INCLUDEDIR)/$${hdr}; done
		$(INSTALL_DATA) $(srcdir)/$(LIBNAME) $(LIBRARY)

shar :
		shar.script $(OTHERS) $(HDRS) $(SOURCES) > $(NAME).sh
		compress $(NAME).sh

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $<

arith.o:	arith.c compface.h data.h
cmain.o:	cmain.c compface.h data.h
compface.o:	compface.c compface.h data.h
compress.o:	compress.c compface.h data.h
file.o:		file.c compface.h data.h
gen.o:		gen.c compface.h data.h
uncmain.o:	uncmain.c compface.h data.h
uncompface.o:	uncompface.c compface.h data.h

.PHONY: clean mostlyclean distclean realclean dist all

# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT: