# # $Id: Makefile.in,v 1.12 1994/10/11 15:45:22 lott Exp lott $ # # Makefile.in for csize, a program to measure the size of C source files # Copyright (C) 1994 Christopher Lott # FB Informatik - Bau 57 / Universitaet KL / D--67653 Kaiserslautern / Germany # # 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. See the file COPYING for more details. # # # to be safe # SHELL = /bin/sh @SET_MAKE@ # # a trick to decide whether to invoke ansi2knr or not # U = @U@ # # in case source and binaries are split # srcdir = @srcdir@ # # an ANSI C compiler is required because of function prototypes # Flex is required. Lex refuses to accept the file scan.l # CC = @CC@ DEFS = @DEFS@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ LEX = @LEX@ # # how to install program and man page # INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ # # where to install the program and man page # prefix = /usr/local exec_prefix = $(prefix) bindir = $(exec_prefix)/bin mandir = $(prefix)/man/man1 manext = .1 CPPFLAGS = -I. -I$(srcdir) $(DEFS) .c.o: $(CC) -c $(CPPFLAGS) $(CFLAGS) $< .l.c: $(LEX) -t $< > $@ # # source files for the program, both documentation and code # all of these files are kept under version control # SRCFILES = README INSTALL csize.man \ Makefile.in configure.in aclocal.m4 configure install.sh \ csize.h csize.c scan.h scan.l patchlevel.h \ ansi2knr.c ansi2knr.1 COPYING ChangeLog # # files needed to build the program # the $U macro will be empty if the compiler supports prototypes, # and have just an underscore if it does not - see targets below # SRCS = scan.l csize.c OBJS = $Uscan.o $Ucsize.o HDRS = scan.h LIBS = all: csize csize: $(OBJS) $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(OBJS): csize.h scan.o: scan.h # # targets to help people without ANSI C compilers # ansi2knr: ansi2knr.c $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(srcdir)/ansi2knr.c _csize.c: csize.c ansi2knr ./ansi2knr $(srcdir)/csize.c > $@ _scan.c: scan.c ansi2knr ./ansi2knr $(srcdir)/scan.c > $@ # # pattern that describes files from test directory # that should be packed into a tar file # need to leave out directory by name of RCS # TESTDIR = t-dir TESTDIRFILES = $(TESTDIR)/README $(TESTDIR)/[A-QS-Za-z]* # # files that can be made and hence nuked # EXTRAFILES = scan.c.flex $(TESTDIR).tar.Z.uu # # files to include in the shar archive # SHARFILES = $(SRCFILES) $(EXTRAFILES) # # Sun's make appears to process the timestamp on a directory differently # from the the timestamp on a file: it does not recognize that the unpacked # directory is newer than the source file. So I put the process in the # user's hands, which I feel is acceptable for an infrequently executed task. # Gnumake *does* recognize that the directory is newer, but I didn't want # to require gnumake. # check: csize @if [ -d $(TESTDIR) ] ; then \ echo "Running tests in subdirectory $(TESTDIR)"; \ cd $(TESTDIR); $(MAKE) -k; \ else \ echo "Please type 'make $(TESTDIR)' to unpack the test files, then 'make $@' again."; \ fi $(TESTDIR): uudecode $(TESTDIR).tar.Z.uu uncompress $(TESTDIR).tar.Z tar xf $(TESTDIR).tar rm -f $(TESTDIR).tar $(TESTDIR).tar.Z.uu: $(TESTDIRFILES) tar cf $(TESTDIR).tar $(TESTDIRFILES) compress $(TESTDIR).tar uuencode $(TESTDIR).tar.Z < $(TESTDIR).tar.Z > $@ rm -f $(TESTDIR).tar.Z install: csize $(INSTALL_PROGRAM) csize $(bindir) $(INSTALL_DATA) csize.man $(mandir)/csize$(manext) uninstall: rm -f $(bindir)/csize rm -f $(mandir)/csize$(manext) checkin: ci -f -l $(SRCFILES) scan.c.flex: scan.c mv $? $@ clean: cd $(TESTDIR); $(MAKE) $@ rm -f scan.c _csize.c _scan.c *.o csize distclean: clean rm -f Makefile config.status ansi2knr realclean: distclean rm -f $(EXTRAFILES) csize.shar* # # pack all files into one shar file # csize.shar: $(SHARFILES) shar -F $(SHARFILES) > $@ # # pack all files into shar files of a size that is suitable for distributing # shar: $(SHARFILES) shar -a -F -n csize -s lott@informatik.uni-kl.de -o csize.shar.part -l 80 $(SHARFILES) # # for configuration etc. # Makefile: Makefile.in config.status $(SHELL) config.status config.status: configure $(SHELL) config.status --recheck configure: configure.in cd $(srcdir); autoconf