delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/08/13/19:16:25

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Message-ID: <BAYC1-PASMTP04FFD175CA69D34F67F6B1EFBF0@cez.ice>
X-Originating-IP: [70.50.143.121]
X-Originating-Email: [april_white AT sympatico DOT ca]
Message-ID: <42FE7EFF.6090200@sympatico.ca>
Date: Sat, 13 Aug 2005 19:15:11 -0400
From: April White <april_white AT sympatico DOT ca>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: djgpp <djgpp AT delorie DOT com>
Subject: help with a makefile
X-OriginalArrivalTime: 13 Aug 2005 23:15:12.0647 (UTC) FILETIME=[DB4AB970:01C5A05C]
Reply-To: djgpp AT delorie DOT com

Hello,

I am trying to set up a Makefile so that I may compile my c++ code using 
DJGPP and MingW into sub-folders, using the environment variable ENV to 
hold the target name

I first thought I could use the VPATH variable and use 'make -C $(ENV)' 
but, after changing into the sub-folder, it always reports:
    *** No targets specified and no makefile found. Stop

I then remove VPATH and tried the vpath variable:
    vpath %.o $(ENV)

and to specify $(ENV) as part of the -o for compiling and linking:
    .cxx.o:
        $(CC) $(CXXFLAGS) -c $< -o $(ENV)/$@
    %.exe: %.o
        $(CC) $(LDFLAGS) -o $(ENV)/$@ $^ $(LOADLIBS)

This compiles all the .o but does not link the .exe in the first 
invocation of make - none of the .o files have the $(ENV) path.
A second invocation of make will call the linker

Can someone give me assistance with this?

April

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019