delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/03/17:22:07

Message-ID: <3485AC81.6B29917@gmx.net>
Date: Wed, 03 Dec 1997 20:01:21 +0100
From: Robert Hoehne <robert DOT hoehne AT gmx DOT net>
MIME-Version: 1.0
To: Martin DOT Bernreuther AT po DOT uni-stuttgart DOT de
CC: "djgpp AT delorie DOT com" <djgpp AT delorie DOT com>
Subject: Re: Makefiles generated from RHIDE
References: <348520C4 DOT 25FE158A AT po DOT uni-stuttgart DOT de>

Martin Bernreuther schrieb:
> 
> If I use e.g. X:/gnuproj/test as a project directory
> and someone else compiles this project in C:\djgpp\Proj\test
> it won't work.
> Is there a possibility to be independent of this Root
> without editing the makefile by hand (or a script file using sed)
> in a second step?

That´s a common problem also for me. I solved this using some sed
scripts. I will show you here a minimal variant which should work.

Create a small makefile with the following contents (I assume here
foo.mak):

-----foo.mak----------------------
SRCDIR:=$(shell pwd)

%.mak: %.gpr
	gpr2mak -d -r- -o - $< \
	  | sed -e 's,	$(DJDIR),	$$(DJDIR),g' \
	        -e '/^		$$(DJDIR).*\\$$/d' \
	        -e 's,^		$$(DJDIR)[^\\]*$$,,' \
	        -e 's,	$(SRCDIR),	$$(SRCDIR),g' > $@

---end of foo.mak------------------

NOTES:
 - The large spaces in the sed scripts above are Tabs !!
 - The sed scripts convert also any absolute path reference
   to you actual DJDIR directory to a refernce using the DJDIR
   variable

As you can see this is an implicit rule for generating a makefile
from a RHIDE project-file. Assuming you have a project called test,
simply run in the directory of that project (assuming foo.mak is also
there)

  make -f foo.mak test.mak


To use the generated test.mak you have to run it either with

  make -f test.mak SRCDIR=.

or modify the sed script in foo.mak.

An other alternative is to place the "%.mak: %.gpr"-rule in a global
makefile and setting the environment variable MAKEFILES to this file
so you will have this rule always available.

> Is there a possibility to generate libraries without editing
> the makefile?

Are there any other problems than the above mentioned?

Robert
-- 
******************************************************
* Robert Hoehne <robert DOT hoehne AT gmx DOT net>              *
* Post:    Am Berg 3, D-09573 Dittmannsdorf, Germany *
* WWW:     http://www.tu-chemnitz.de/~sho/rho        *
******************************************************

- Raw text -


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