[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simpler way to run Make in selected directories

From: Bob Stark
Subject: Simpler way to run Make in selected directories
Date: Fri, 13 Jan 2006 17:23:57 -0500

I have a library of common files, included in multiple projects.

When I change a common file, I manually issue "make all" in each directory that uses one of these files. This is now starting to get out of hand.

I built the following test makefile to descend into those directories and issue "make all". But I have violated Paul D. Smith's "rule #4" (never write filenames more than once).

In the makefile shown below, I have targets COURSE1, COURSE2, etc. which are virtually identical, and I need to create another one each time I add a new directory. I really want it to be generic. Can someone suggest how to simplify this makefile? I tried several things, but I need a 2nd pair of eyeballs.

# Makefile for building the student workbook
COURSE1  =..\..\Java_Programming_Essentials_Eclipse\PT3610
COURSE2  =..\..\Java_Programming_Essentials_RAD\PT3846
COURSE3  =..\..\Java_Programming_Essentials_multiple_IDE\PT3847
COURSE4  =..\..\Java_Programming_Essentials_WSAD512\PT3848


# This is the default target
.PHONY         : help
help           :
        @echo make java       Build all java courses

.PHONY         : JAVA

# % :: $(COURSEDIR) ; :

.PHONY         : COURSE1
COURSE1        : $(COURSE1)
        cd ${<} && $(MAKE) all

.PHONY         : COURSE2
COURSE2        : $(COURSE2)
        cd ${<} && $(MAKE) all

.PHONY         : COURSE3
COURSE3        : $(COURSE3)
        cd ${<} && $(MAKE) all

.PHONY         : COURSE4
COURSE4        : $(COURSE3)
        cd ${<} && $(MAKE) all

reply via email to

[Prev in Thread] Current Thread [Next in Thread]