help with Makefile

Bill Daniels wrd3156 at fedeva.UUCP
Thu Aug 11 04:12:20 AEST 1988


I am having trouble creating a reasonable Makefile for a system with sources
and executables in separate directories.  The current Makefile resides in the 
bin directory, easily recognizing the executable dependencies. A preprocessor
required by UNIFY seems to need to be run from the source directory
seemingly forcing the ".o" dependency to chdir to the src directory before
executing (ucc for those of you familiar with UNIFY).  Here's a cut of the
current entry:

DEFS=../def
DIR1=../src
INC=/usr/include
UNINC=/unify/include
LOCINC=../src/include
UCC=/unify/bin/ucc -c -R -O
ULD=/unify/bin/uld

init_db: $(DIR1)/init_db.o
	/bin/sh $(ULD) init_db \
	    $(DIR1)/init_db.o

$(DIR1)/init_db.o: $(DIR1)/init_db.c $(DEFS)/file.h \
		   $(LOCINC)/cr.h $(LOCINC)/input.h
	cd $(DIR1); $(UCC) init_db.c


This works ok!  My problems have appeared with the decision to install the
sources in sccs.  The augmented make does all the wonderfully proper things
about "get -p"ing if necessary but leaves ugly ".c"s around after the 
compilation has completed.  Moving the Makefile into the src directory
leaves my executables in the source directory, which we would like to avoid.
HELP!!!
-- 
bill daniels
federal express, memphis, tn
{hplabs!csun,gatech!emcard,mit-eddie!premise}!fedeva!wrd3156



More information about the Comp.unix.questions mailing list