Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_SRC_3_19910112 - unix-stuff/makefile.unx
There are no other files named makefile.unx in the archive.
.SUFFIXES: .c .o .obj .exe .a .lib .h .h4 .tmp
CFLAGS=-DDEBUG -g
#CFLAGS=-O
MACHINE=BSD
#LOCAL=/usr/include/local
LOCAL=.
LOCALINCLUDES= ${LOCAL}/ccmd.h ${LOCAL}/cmfnc.h ${LOCAL}/cmfncs.h ${LOCAL}/datime.h $(LOCAL)/ccmdmd.h
# termination char for cmds.   ";" for msc
CMDTERM=
# CMDTERM=;

# command to invoke C compiler
CC=cc $(CFLAGS) -D$(MACHINE) -c
# CC=msc
# CC=lc

# command to delete a file
RM=rm
# RM=erase

# command to invoke the linker
#LINK=cc $(CFLAGS) -o $@ $@.${OBJ} -lccmd -ltermlib $(CMDTERM) 
LINK=cc $(CFLAGS) -o $@ $@.${OBJ} ccmd.a -ltermlib $(CMDTERM) 
# LINK=link $*.${OBJ},$@,,$(LIBNAME) $(CMDTERM)

# command to copy a file
COPY=cp
# COPY=copy

# name of library to create
LIBNAME=ccmd-noran.a
# LIBNAME=ccmd.lib

# command to add an object file to a library
LIBADD=ar r $(LIBNAME) $?
# LIBADD=lib $(LIBNAME)+$<-$<

# command to reorder the library
RANLIB=ranlib
# RANLIB=rem

# special file extension for this OS
EXT=unx
# EXT=DOS

# extention for EXE files.
EXE=
# EXE=.exe

# extension for OBJ files
OBJ=o
# OBJ=obj

SPLITDIR=./

all: xxx test

ccmd: ccmd.a

split$(EXE): split.c
	$(CC) split.c $(CMDTERM)
	cc -o split split.o

cmfnc.h: cmfnc.h4 cmconf.h4 cmcfm.cnf cmkey.cnf cmnum.cnf cmfld.cnf \
	 cmqst.cnf cmtxt.cnf cmswi.cnf cmtad.cnf cmtok.cnf cmnoi.cnf \
	 cmgnrc.cnf cmfil.cnf cmusr.cnf cmgrp.cnf cmpara.cnf split$(EXE)
	m4 cmfnc.h4 > cmfnc.tmp
	$(SPLITDIR)split < cmfnc.tmp
	$(RM) cmfnc.tmp

cmfncs.h: cmfnc.h4 cmconf.h4 cmcfm.cnf cmkey.cnf cmnum.cnf cmfld.cnf \
	  cmqst.cnf cmtxt.cnf cmswi.cnf cmtad.cnf cmtok.cnf cmnoi.cnf \
	  cmgnrc.cnf cmfil.cnf cmusr.cnf cmgrp.cnf cmpara.cnf split$(EXE)
	m4 cmfnc.h4 > cmfnc.tmp
	$(SPLITDIR)split < cmfnc.tmp
	$(RM) cmfnc.tmp

ccmd.$(OBJ): ccmd.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) ccmd.c $(CMDTERM)

ccmdut.$(OBJ): ccmdut.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) ccmdut.c $(CMDTERM)

ccmdio.$(OBJ): ccmdio.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) ccmdio.c $(CMDTERM)

ccmdmd.c: ccmdmd.$(EXT)
	$(COPY) ccmdmd.$(EXT) ccmdmd.c

ccmdmd.$(EXT):

ccmdmd.$(OBJ): ccmdmd.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) ccmdmd.c $(CMDTERM)

ccmdst.$(OBJ): ccmdst.c ccmd.h ccmdmd.h cmfnc.h cmfnc.h cmfncs.h
	$(CC) ccmdst.c $(CMDTERM)

stdact.$(OBJ): stdact.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) stdact.c $(CMDTERM)

cmcfm.$(OBJ): cmcfm.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) cmcfm.c $(CMDTERM)

cmkey.$(OBJ): cmkey.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) cmkey.c $(CMDTERM)

cmnum.$(OBJ): cmnum.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) cmnum.c $(CMDTERM)

cmqst.$(OBJ): cmqst.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) cmqst.c $(CMDTERM)

cmnoi.$(OBJ): cmnoi.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) cmnoi.c $(CMDTERM)

cmtxt.$(OBJ): cmtxt.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) cmtxt.c $(CMDTERM)

cmfld.$(OBJ): cmfld.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) cmfld.c $(CMDTERM)

cmtok.$(OBJ): cmtok.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) cmtok.c $(CMDTERM)

cmswi.$(OBJ): cmswi.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) cmswi.c $(CMDTERM)

cmtad.$(OBJ): cmtad.c ccmd.h ccmdmd.h datime.h cmfnc.h cmfncs.h
	$(CC) cmtad.c $(CMDTERM)

datime.$(OBJ): datime.c datime.h tzone.h dtpat.h
	$(CC) datime.c $(CMDTERM)

cmfil.$(OBJ): cmfil.c ccmd.h ccmdmd.h cmfil.h cmfnc.h cmfncs.h cmfbrk.$(EXT)
	$(CC) cmfil.c $(CMDTERM)

filelist.$(OBJ): filelist.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) filelist.c $(CMDTERM)

wild.$(OBJ): wild.c
	$(CC) wild.c $(CMDTERM)

cmfbrk.$(EXT):

cmusr.$(OBJ): cmusr.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h cmusr.h
	$(CC) cmusr.c $(CMDTERM)

cmgrp.$(OBJ): cmgrp.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h cmgrp.h
	$(CC) cmgrp.c $(CMDTERM)

cmpara.$(OBJ): cmpara.c ccmd.h ccmdmd.h cmfnc.h cmfncs.h
	$(CC) cmpara.c $(CMDTERM)

cmmisc.$(OBJ): cmmisc.c ccmd.h ccmdmd.h cmfnc.h 

$(LIBNAME):: ccmd.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: ccmdut.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: ccmdio.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: ccmdmd.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: ccmdst.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: stdact.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmcfm.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmkey.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmnum.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmqst.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmnoi.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmtxt.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmfld.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmtok.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmswi.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmtad.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: datime.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmfil.$(OBJ)
	$(LIBADD) $(CMDTERM)
$(LIBNAME):: filelist.$(OBJ)
	$(LIBADD)  $(CMDTERM)

$(LIBNAME):: wild.$(OBJ)
	$(LIBADD) $(CMDTERM)

#only for msdos
# dir.${OBJ}: dir.c
#	$(CC) dir.c $(CMDTERM)
#
# $(LIBNAME):: dir.$(OBJ)
#	$(LIBADD) $(CMDTERM)
#end msdos only

$(LIBNAME):: cmusr.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmgrp.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmpara.$(OBJ)
	$(LIBADD) $(CMDTERM)

$(LIBNAME):: cmmisc.$(OBJ)
	$(LIBADD) $(CMDTERM)

ccmd.a:	$(LIBNAME)
	$(COPY) $(LIBNAME) ccmd.a
	$(RANLIB) ccmd.a

$(LOCAL)/ccmd.h: ccmd.h
	cp ccmd.h $(LOCAL)

$(LOCAL)/ccmdmd.h: ccmdmd.h
	cp ccmdmd.h $(LOCAL)

$(LOCAL)/cmfnc.h: cmfnc.h
	cp cmfnc.h $(LOCAL)

$(LOCAL)/cmfncs.h: cmfncs.h
	cp cmfncs.h $(LOCAL)

$(LOCAL)/datime.h: datime.h
	cp datime.h $(LOCAL)

install: $(LOCALINCLUDES) ccmd.a
	cp ccmd.a /usr/local/lib/libccmd.a
	ranlib /usr/local/lib/libccmd.a
#	cp ccmd.h cmfnc.h ccmdmd.h datime.h $(LOCAL) 

/usr/local/lib/libccmd.a: $(LOCALINCLUDES) ccmd.a
	make install
	

test.$(OBJ): test.c ccmd.h ccmdmd.h cmfnc.h datime.h
	$(CC) test.c $(CMDTERM)

#test$(EXE): $(LOCALINCLUDES) test.$(OBJ) /usr/local/lib/libccmd.a
test$(EXE): $(LOCALINCLUDES) test.$(OBJ) ccmd.a
	$(LINK)

xxx.$(OBJ): xxx.c ccmd.h ccmdmd.h cmfnc.h 
	$(CC) xxx.c $(CMDTERM)

#xxx$(EXE): $(LOCALINCLUDES) xxx.$(OBJ) /usr/local/lib/libccmd.a 
xxx$(EXE): xxx.$(OBJ) ccmd.a
	$(LINK)