gno/usr.orca.bin/udl/Makefile.unx
gdr 53e5462236 Changed Makefile.unx to select what should be the proper
defines automatically, based on the result of `uname -sr`.
Added Linux defines.
Changed references and definition of "mktemp" to "Mktemp".  There
   is a discrepancy between the internal implementation and
   other common Unix versions.
Added a section to this README on installation, and moved the
   description of the DEFINES from the makefiles to here.
On the IIgs version, the resource fork is now created from a
   resource source file that is compiled, rather than using
   an interactive tool to create the resource fork.
Changed source filenames to use the 8.3 format in anticipation of
   MS-DOS support.  This does not affect the file names upon which
   udl operates.
1996-01-22 01:01:36 +00:00

95 lines
2.2 KiB
Makefile

#
# Makefile for udl
# (c) 1993-1996 Soenke Behrens
#
# $Id: Makefile.unx,v 1.7 1996/01/22 01:01:31 gdr Exp $
#
# $(CC) _must_ be an ANSI compiler.
CC = cc
BINDIR = /usr/local/bin
MANDIR = /usr/local/man/man1
INSTALL = /usr/bin/install
# These are arguments to $(INSTALL)
MODE644 = -m 644
MODE755 = -m 755
OWNER_GROUP = -o bin -g sys
# You should not have to modify anything beyond this point
##########################################################
#
# OS-dependant macros. See the README for an explanation of these.
#
DEFINES_AIX = -DBROKEN_REALLOC -D_POSIX_C_SOURCE -D_POSIX_SOURCE
DEFINES_Linux = -DREADDIR_RETURNS_DOT -D_POSIX_C_SOURCE -D_POSIX_SOURCE \
-DHAS_ATEXIT
DEFINES_Solaris = -DREADDIR_RETURNS_DOT -D_POSIX_C_SOURCE -D_POSIX_SOURCE \
-DBROKEN_DIRENT_STRUCT
LDLIBS_Solaris = -lucb
DEFINES_SunOS = -DREADDIR_RETURNS_DOT -D_POSIX_C_SOURCE -D_POSIX_SOURCE \
-DBROKEN_REALLOC
CFLAGS = $(DEFINES_$(OS)) -O
LDFLAGS = $(LDFLAGS_$(OS)) -s
LDLIBS = $(LDLIBS_$(OS))
OBJS = udl.o udluse.o common.o globals.o
build:
@os_string=`uname -sr | tr ' ' '_'`; \
case $$os_string in \
SunOS_4*) os=SunOS;; \
SunOS_5*) os=Solaris;; \
AIX*) os=AIX;; \
Linux*) os=Linux;; \
*) echo "don't know about OS $$os_string"; \
exit -1;; \
esac; \
$(MAKE) udl -f Makefile.unx OS=$$os
udl: $(OBJS)
$(CC) $(LDFLAGS) -o udl $(OBJS) $(LDLIBS)
udl.o: udlunix.c common.h
$(CC) -c $(CFLAGS) -o udl.o udlunix.c
newudl.1: udl.1
@echo "creating newudl.1"; \
echo '/^.TH/ c\' > sed.script; \
echo '.TH UDL 1 "15 January 1996" "Version 1.15"\
"Commands and Applications"' >>sed.script; \
sed -f sed.script <udl.1 >newudl.1; \
rm -f sed.script
install: newudl.1 udl
$(INSTALL) $(MODE755) $(OWNER_GROUP) udl $(BINDIR)
$(INSTALL) $(MODE644) $(OWNER_GROUP) newudl.1 $(MANDIR)/udl.1
rm -f newudl.1
clean:
-rm -f *.o *~ core
clobber: clean
-rm -rf udl newudl.1 help
dist: clobber
@echo "creating archive"; \
cwd=`pwd`; \
parent=`dirname $$cwd`; \
dir=`basename $$cwd`; \
cd $$parent; \
archive=$$dir.tar.Z; \
if [ -f $$archive ]; then \
echo "please move $$parent/$$archive out of the way, first"; \
exit -1; \
fi; \
tar -cf - $$dir | compress > $$archive
udluse.o common.o globals.o:: common.h