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 136
|
#
# UnixCW - Unix CW (Morse code) training program
# Copyright (C) 2001 Simon Baldwin (simonb@caldera.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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
ROOT = ..
SHELL = /bin/sh
#
# Portability options
#
CC = @CC@
CFLAGS = @CFLAGS@ @CFLAG_PIC@ @DEFS@
AWK = @AWK@
RANLIB = @RANLIB@
GZIP = @GZIP@
LD = @LD@
LINKS_SO = @LINKS_SO@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
prefix = @prefix@
exec_prefix = @exec_prefix@
includedir = @includedir@
libdir = @libdir@
mandir = @mandir@
#
# List of object files built in this directory
#
OBJECTS = cwlib.o cwlibtest.o
default: all
#
# Build the runtime .o, and both the static and shared libraries
# Out of a sense of civic duty, this Makefile builds the self test
# functions into libcw right alongside the library itself. How's
# that for keeping code and its tests together?
#
all: libcw.a libcw.so cwlib.3
libcw.a: $(OBJECTS)
rm -f libcw.a; ar -cr libcw.a $(OBJECTS)
$(RANLIB) libcw.a
libcw.so: $(OBJECTS)
if [ "$(LINKS_SO)" = "yes" ]; then \
$(CC) -shared -o libcw.so $(OBJECTS); \
fi
cwlib.3: cwlib.3.m4 cwlib.c
$(AWK) -f libdoc.awk <cwlib.c | $(AWK) -f libsigs.awk >signatures
$(AWK) -f libdoc.awk <cwlib.c | $(AWK) -f libfuncs.awk >functions
$(AWK) -f include.awk <cwlib.3.m4 >cwlib.3
rm -f signatures functions
#
# Define dependencies related to header/include files
#
cwlib.o: Makefile cwlib.h
cwlibtest.o: Makefile cwlib.h
#
# Install targets
#
install:
$(INSTALL) -d $(DESTDIR)$(includedir) $(DESTDIR)$(libdir) $(DESTDIR)$(mandir)/man3 $(DESTDIR)$(mandir)/man7
$(INSTALL_DATA) cwlib.h $(DESTDIR)$(includedir)/cwlib.h
$(INSTALL_DATA) libcw.a $(DESTDIR)$(libdir)/libcw.a
if [ "$(LINKS_SO)" = "yes" ]; then \
strip --strip-unneeded libcw.so; \
$(INSTALL_PROGRAM) -s -m 0644 libcw.so $(DESTDIR)$(libdir)/libcw.so; \
fi
$(INSTALL_DATA) cwlib.3 $(DESTDIR)$(mandir)/man3/cwlib.3
$(GZIP) -f -9 $(DESTDIR)$(mandir)/man3/cwlib.3
$(INSTALL_DATA) cw.7 $(DESTDIR)$(mandir)/man7/cw.7
$(GZIP) -f -9 $(DESTDIR)$(mandir)/man7/cw.7
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
uninstall:
rm -f $(includedir)/cwlib.h
rm -f $(libdir)/libcw.a
rm -f $(libdir)/libcw.so
rm -f $(mandir)/man3/cwlib.3 $(mandir)/man3/cwlib.3.gz
rm -f $(mandir)/man7/cw.7 $(mandir)/man7/cw.7.gz
rm -f $(mandir)/man7/CW.7 $(mandir)/man7/CW.7.gz
#
# Cleanup targets
#
clean:
rm -f libcw.a libcw.so *.s *.o
rm -f cwlib.3 signatures functions
rm -f cwlibtest
rm -f core
distclean: clean
rm -f Makefile
mostlyclean: clean
maintainer-clean: distclean
#
# Test targets
#
check: libcw.a
$(CC) -o cwlibtest testharness.c $(OBJECTS)
-@./cwlibtest
#
# Unimplemented targets
#
TAGS:
info:
dvi:
dist:
|