🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #6973

Re: Make doc

#6973
From: Cameron Laird
Date: Tue, 18 Jun 1996 00:00
52 lines
2301 bytes
In article <4q4kd5$cm3@Starbase.NeoSoft.COM>, I responded to
Ronan Viel  <viel@efp.poznan.pl>'s article
<31BEEDDD.41C6@efp.poznan.pl>, in which he asked:
>>I'm looking for a Make (GNU) documentation. I had a doc called
			.
			.
			.
><URL:http://www.rz.go.dlr.de:8081/pdinfo_dv/gnumake.html>
			.
			.
			.
While we're on the subject, I have a couple of usage questions,
one of which I'll offer now.  Is there a way to parametrize de-
pendencies?  Here's an example of what I mean:

	# This is a GNUmakefile for that classic
	#     situation in which one wants to main-
	#     tain multiple objects derived from a
	#     single source base

	# Lots of other set-up might be here ...

	both:
		gnumake -f make_single_executable \
			OPTION="" OBJ=for_real \
			EXECUTABLE=application
		gnumake -f make_single_executable \
			OPTION="-DTEST" OBJ=test \
			EXECUTABLE=test_application
	============================================
	# This is make_single_executable.

	OBJECTS = $(OBJ)/module1.o \
			$(OBJ)/module2.o \
			$(OBJ)/module3.o

	$(OBJ)/%.o:  %.c
		cc $(OPTION) $*.c -o $(OBJ)/$*.o

	$(EXECUTABLE):  $(OBJECTS)
		cc -o $(EXECUTABLE) $(OBJECTS)

Is there a way to "single-source" that efficiently, so that
"recursion" of makefiles is not necessary?

I've trimmed follow-ups a bit.
-- 

Cameron Laird           http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com      +1 713 623 8000 #227
                        +1 713 996 8546 FAX
Technical Details
Message-ID: <4q6gfp$ro6@Starbase.NeoSoft.COM>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <31BEEDDD.41C6@efp.poznan.pl> <4q4kd5$cm3@Starbase.NeoSoft.COM>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f891f,97469e5b7689ff05
X-Google-Attributes: gidf891f,public
X-Google-Thread: 108717,4990233ca2810ae5,start
X-Google-Attributes: gid108717,public
X-Google-Thread: 114f47,4990233ca2810ae5,start
X-Google-Attributes: gid114f47,public
X-Google-Thread: 1025b4,25977f3ecc564ef5
X-Google-Attributes: gid1025b4,public
From: claird@Starbase.NeoSoft.COM (Cameron Laird)
Subject: Re: Make doc
Date: 1996/06/18
Message-ID: <4q6gfp$ro6@Starbase.NeoSoft.COM>
X-Deja-AN: 160839904
references: <31BEEDDD.41C6@efp.poznan.pl> <4q4kd5$cm3@Starbase.NeoSoft.COM>
organization: NeoSoft, Inc. +1 713 968 5800
followup-to: comp.programming,gnu.misc.discuss
newsgroups: comp.lang.misc,gnu.misc.discuss,comp.software.config-mgmt,comp.programming