Re: MAKEFILE - only the first command ever works

From: Andy Sinclair (me_at_privacy.net)
Date: 12/09/04


Date: Thu, 09 Dec 2004 15:40:38 +0000

Multiple makefiles are a common solution to complicated builds.
You can use a hierachy like this:

THISDIR = C:\TEMP
MAINDIR = $(THISDIR)\MyMainApp
APP1DIR = $(THISDIR)\MyComponent1
APP2DIR = $(THISDIR)\MyComponent2
APP3DIR = $(THISDIR)\MyComponent3
MAINTARGET = $(MAINDIR)\MyMainApp.exe
APP1TARGET = $(APP1DIR)\MyComponent1.exe
APP2TARGET = $(APP2DIR)\MyComponent2.exe
APP3TARGET = $(APP3DIR)\MyComponent3.exe

$(MAINTARGET) : $(APP1TARGET)
        cd $(MAINDIR)
        make

$(APP1TARGET) : $(APP2TARGET)
        cd $(APP1DIR)
        make

$(APP2TARGET) : $(APP3TARGET)
        cd $(APP2DIR)
        make

$(APP3TARGET) :
        cd $(APP3DIR)
        make