Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!sm.unisys.com!csun!fedeva!wrd3156 From: wrd3156@fedeva.UUCP (Bill Daniels) Newsgroups: comp.unix.questions Subject: help with Makefile Keywords: make, sccs, separate src and bin directories Message-ID: <370@fedeva.UUCP> Date: 10 Aug 88 18:12:20 GMT Organization: Federal Express Corp., Memphis, TN Lines: 35 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