Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <0E7AA454E229D411A1CB0090274661FF5502FB@gaea.trillium.com> From: Brian Pollard To: "'cygwin AT sources DOT redhat DOT com'" , "'cygwin AT sourceware DOT cygnus DOT com'" Subject: how to use a make file in cygwin? Date: Fri, 21 Jul 2000 10:46:52 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" I know my code will compile and run in cygwin but i want to use a makefile to do this instead of compiling line by line. Can someone please offer a suggestion to what is being done wrong in my makefile. Are the makefile structured differently than a unix makefile? Thank you for your time Brian The following is my makefile: SSOPTS= -DCMFILE_REORG_1 -DSTDIO_INCLD MTOPTS= -DCMFILE_REORG_1 -DSTDIO_INCLD ACOPTS= -DCMFILE_REORG_1 -DSTDIO_INCLD CMOPTS= -DCMFILE_REORG_1 -DSTDIO_INCLD #----------------------------------------------------------------------- # macro for output file name and makefile name # OUTNAME=mt_acc MAKENAME=mt_acc.mak #----------------------------------------------------------------------- # macro for include directories # SY_DIR=. # object files and executable directory SS_DIR=. # common system services CM_DIR=. # common directory MT_DIR=. # MTSS directory AC_DIR=. # acceptance directory INC_DIR=-I. -I$(CM_DIR) -I$(SS_DIR) # include directory #----------------------------------------------------------------------- # macros for compile and link options # TRACE= # trace LIST= # listing # environment: # -DMSC60 microsoft c 6.0 # -DMSC51 microsoft c 5.1 # -DMSC70 microsoft c 7.0 # -DBOR31 borland c++ 3.1 # -DANSI ansi # # dos # -DUNIX unix # -DSUNOS sunos #ENV=-DANSI -DWIN32 # environment, microsoft ENV=-DANSI -DSUNOS -D_REENTRANT # environment, sunos # lint: LINT=lin.bat # dos batch command # lint options: LNTOPTS=-dDSTDIO_INCLD -dCONSTDIO # lint option (same as MTOPTS) LNTENV=-dMSC60 -dANSI -dDOS # lint environment (same as ENV) LNTOPTION=$(LNTOPTS) $(LNTENV) -i$(CM_DIR) # compiler: # cl DOS # cc UNIX #CC=cl # compiler, microsoft #CC=cc # compiler, sunos CC=gcc # compiler, gnu # PURIIFY PURE= #PURE=/opt/pure/purify/purify # object files: # obj DOS # o UNIX #OBJ=obj # object files, microsoft OBJ=o # object files, sunos # memory model: # -AS small UNIX # -AM medium # -AC compact # -AL large # -AH huge #MODEL= # memory model, microsoft MODEL= # memory model, sunos # compiler options: # # microsoft # # -D define # -W3 warning level 3 # -Od optimization disabled # -Za disable language extensions # -Zi required for Code View # -c compile without linking # -I include path # -Gs disable stack check # -EM extended memory manager # # sunos # # -g debugger # -fast optimize for speed # -Xa conforming ANSI mode # -Xc maximally conforming ANSI mode #COPTS=-Od -W3 # compiler options, microsoft #COPTS=-g3 -traditional -Wall -Wno-comment -pipe -Wshadow -Wcast-qual \ # -Wconversion # GNU K&R compiler options COPTS=-g3 -Wall -Wno-comment -pipe -Wshadow -Wcast-qual \ -Wstrict-prototypes -Wmissing-prototypes # GNU ansi compiler options #COPTS=-Xa -g -mt # compiler options, solaris # linker options: # /CO required for Code View # /NOI preserve case sensitivity # /ST: stack siz #LOPTS=/CO /NOI /NOE /ST:25000 # linker options LOPTS=-lpthread -lposix4 CMTOPTS=$(TRACE) $(MODEL) $(MTOPTS) $(ENV) $(COPTS) $(INC_DIR) CACOPTS=$(TRACE) $(MODEL) $(ACOPTS) $(ENV) $(COPTS) $(INC_DIR) CCMOPTS=$(TRACE) $(MODEL) $(CMOPTS) $(ENV) $(COPTS) $(INC_DIR) CSSOPTS=$(TRACE) $(MODEL) $(SSOPTS) $(ENV) $(COPTS) $(INC_DIR) LOPTION=$(LOPTS) #----------------------------------------------------------------------- # macros for include files # ENV_INC=$(CM_DIR)/envdep.h $(CM_DIR)/envind.h $(CM_DIR)/envopt.h # environment SSI_INC=$(CM_DIR)/ssi.h $(CM_DIR)/ssi.x # system services GEN_INC=$(CM_DIR)/gen.h $(CM_DIR)/gen.x # general layer SS_INC=$(SS_DIR)/ss_dep.h $(SS_DIR)/ss_dep.x $(SS_DIR)/ss_err.h $(SS_DIR)/ss_drvr.x $(SS_DIR)/ss_gen.h $(SS_DIR)/ss_gen.x $(SS_DIR)/ss_mem.h $(SS_DIR)/ss_mem.x $(SS_DIR)/ss_msg.h $(SS_DIR)/ss_msg.x $(SS_DIR)/ss_queue.h $(SS_DIR)/ss_queue.x $(SS_DIR)/ss_strm.h $(SS_DIR)/ss_strm.x $(SS_SIR)/ss_task.h $(SS_DIR)/ss_task.x $(SS_DIR)/ss_timer.x # common SS MT_INC=$(MT_DIR)/mt_ss.h $(MT_DIR)/mt_ss.x $(MT_DIR)/mt_err.h # MTSS #----------------------------------------------------------------------- # macro for object files # SRCS= \ $(SS_DIR)/ss_gen.c \ $(SS_DIR)/ss_task.c \ $(SS_DIR)/ss_drvr.c \ $(SS_DIR)/ss_timer.c \ $(SS_DIR)/ss_mem.c \ $(SS_DIR)/ss_strm.c \ $(SS_DIR)/ss_msg.c \ $(SS_DIR)/ss_queue.c \ $(SS_DIR)/ss_pack.c \ $(SS_DIR)/ss_rtr.c \ $(SS_DIR)/ss_acc.c \ $(CM_DIR)/cm_mem.c \ $(CM_DIR)/cm_bdy5.c \ $(MT_DIR)/mt_ss.c \ $(MT_DIR)/mt_id.c OBJS= \ $(SY_DIR)/ss_gen.$(OBJ) \ $(SY_DIR)/ss_task.$(OBJ) \ $(SY_DIR)/ss_drvr.$(OBJ) \ $(SY_DIR)/ss_timer.$(OBJ) \ $(SY_DIR)/ss_mem.$(OBJ) \ $(SY_DIR)/ss_strm.$(OBJ) \ $(SY_DIR)/ss_msg.$(OBJ) \ $(SY_DIR)/ss_queue.$(OBJ) \ $(SY_DIR)/ss_pack.$(OBJ) \ $(SY_DIR)/ss_rtr.$(OBJ) \ $(SY_DIR)/ss_acc.$(OBJ) \ $(SY_DIR)/cm_mem.$(OBJ) \ $(SY_DIR)/cm_bdy5.$(OBJ) \ $(SY_DIR)/mt_ss.$(OBJ) \ $(SY_DIR)/mt_id.$(OBJ) #----------------------------------------------------------------------- # UNIX link - absolute object file depends on relocatable object # (.o) files # $(OUTNAME): $(OBJS) $(PURE) $(CC) -o $(OUTNAME) $(OBJS) $(LOPTS) depend: $(SRCS) makedepend -f $(MAKENAME) -- $(ENV) $(MTOPTS) $(CMOPTS) $(INC_DIR) -- $(SRCS) clean: -/bin/rm -f $(OUTNAME) *.o *.i #----------------------------------------------------------------------- # lint # #lint: # $(LINT) $(LNTOPTION) $(OUTNAME).lnt > $(OUTNAME).ler #----------------------------------------------------------------------- # DOS Microsoft 6.0 link - absolute object (.exe) file depends on # relocatable object (.obj) files # #$(OUTNAME).exe: $(OBJS) $(OUTNAME).lnk # link $(LOPTION) @$(OUTNAME).lnk #----------------------------------------------------------------------- # relocatable object (.obj) files depend on respective source (.c) and # include (.h and .x) files # # note: if an include file includes another include file then the second # include file must also be shown on the dependency list # $(SY_DIR)/ss_gen.$(OBJ): $(SS_DIR)/ss_gen.c $(PURE) $(CC) -c $(CSSOPTS) $(SS_DIR)/ss_gen.c $(SY_DIR)/ss_task.$(OBJ): $(SS_DIR)/ss_task.c $(PURE) $(CC) -c $(CSSOPTS) $(SS_DIR)/ss_task.c $(SY_DIR)/ss_drvr.$(OBJ): $(SS_DIR)/ss_drvr.c $(PURE) $(CC) -c $(CSSOPTS) $(SS_DIR)/ss_drvr.c $(SY_DIR)/ss_timer.$(OBJ): $(SS_DIR)/ss_timer.c $(PURE) $(CC) -c $(CSSOPTS) $(SS_DIR)/ss_timer.c $(SY_DIR)/ss_mem.$(OBJ): $(SS_DIR)/ss_mem.c $(PURE) $(CC) -c $(CSSOPTS) $(SS_DIR)/ss_mem.c $(SY_DIR)/ss_strm.$(OBJ): $(SS_DIR)/ss_strm.c $(PURE) $(CC) -c $(CSSOPTS) $(SS_DIR)/ss_strm.c $(SY_DIR)/ss_msg.$(OBJ): $(SS_DIR)/ss_msg.c $(PURE) $(CC) -c $(CSSOPTS) $(SS_DIR)/ss_msg.c $(SY_DIR)/ss_queue.$(OBJ): $(SS_DIR)/ss_queue.c $(PURE) $(CC) -c $(CSSOPTS) $(SS_DIR)/ss_queue.c $(SY_DIR)/ss_pack.$(OBJ): $(SS_DIR)/ss_pack.c $(PURE) $(CC) -c $(CSSOPTS) $(SS_DIR)/ss_pack.c $(SY_DIR)/ss_rtr.$(OBJ): $(SS_DIR)/ss_rtr.c $(PURE) $(CC) -c $(CSSOPTS) $(SS_DIR)/ss_rtr.c $(SY_DIR)/ss_acc.$(OBJ): $(SS_DIR)/ss_acc.c $(PURE) $(CC) -c $(CSSOPTS) $(SS_DIR)/ss_acc.c $(SY_DIR)/cm_mem.$(OBJ): $(CM_DIR)/cm_mem.c $(PURE) $(CC) -c $(CCMOPTS) $(CM_DIR)/cm_mem.c $(SY_DIR)/cm_bdy5.$(OBJ): $(CM_DIR)/cm_bdy5.c $(PURE) $(CC) -c $(CCMOPTS) $(CM_DIR)/cm_bdy5.c $(SY_DIR)/mt_ss.$(OBJ): $(MT_DIR)/mt_ss.c $(PURE) $(CC) -c $(CMTOPTS) $(MT_DIR)/mt_ss.c $(SY_DIR)/mt_id.$(OBJ): $(MT_DIR)/mt_id.c $(PURE) $(CC) -c $(CMTOPTS) $(MT_DIR)/mt_id.c #----------------------------------------------------------------------- # DOS Microsoft 5.1 link - absolute object (.exe) file depends on # relocatable object (.obj) files # #$(OUTNAME).exe: $(OBJS) $(OUTNAME).lnk # link $(LOPTION) @$(OUTNAME).lnk #---------------------------------------------------------------- # lint # #lint: # $(LINT) $(LNTOPTION) $(OUTNAME).lnt > $(OUTNAME).ler # DO NOT DELETE THIS LINE -- make depend depends on it. The following is the output: [brianp AT FONS:~/mtss]$ make -f mt_acc.mak mt_acc.mak:319: warning: overriding commands for target `.' mt_acc.mak:316: warning: ignoring old commands for target `.' mt_acc.mak:322: warning: overriding commands for target `.' mt_acc.mak:319: warning: ignoring old commands for target `.' mt_acc.mak:325: warning: overriding commands for target `.' mt_acc.mak:322: warning: ignoring old commands for target `.' mt_acc.mak:328: warning: overriding commands for target `.' mt_acc.mak:325: warning: ignoring old commands for target `.' mt_acc.mak:331: warning: overriding commands for target `.' mt_acc.mak:328: warning: ignoring old commands for target `.' mt_acc.mak:334: warning: overriding commands for target `.' mt_acc.mak:331: warning: ignoring old commands for target `.' mt_acc.mak:337: warning: overriding commands for target `.' mt_acc.mak:334: warning: ignoring old commands for target `.' mt_acc.mak:340: warning: overriding commands for target `.' mt_acc.mak:337: warning: ignoring old commands for target `.' mt_acc.mak:343: warning: overriding commands for target `.' mt_acc.mak:340: warning: ignoring old commands for target `.' mt_acc.mak:346: warning: overriding commands for target `.' mt_acc.mak:343: warning: ignoring old commands for target `.' mt_acc.mak:349: warning: overriding commands for target `.' mt_acc.mak:346: warning: ignoring old commands for target `.' mt_acc.mak:352: warning: overriding commands for target `.' mt_acc.mak:349: warning: ignoring old commands for target `.' mt_acc.mak:355: warning: overriding commands for target `.' mt_acc.mak:352: warning: ignoring old commands for target `.' mt_acc.mak:358: warning: overriding commands for target `.' mt_acc.mak:355: warning: ignoring old commands for target `.' make: Circular . <- . dependency dropped. make: *** No rule to make target `/mt_id.c', needed by `.'. Stop. -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com