Project

General

Profile

Feature #24

object files collected in one directory

Added by Anna Maria Bigatti over 12 years ago. Updated over 3 years ago.

Status:
Rejected
Priority:
Normal
Category:
Makefile
Target version:
Start date:
08 Nov 2011
Due date:
% Done:

100%

Estimated time:
1.01 h
Spent time:

Description

Step 1: all objects files should be created in one directory. This should facilitate makefile dependencies.

Step 2: all object files should be in directories "obj-OPT", "obj-DEBUG1",...


Related issues

Related to CoCoALib - Feature #665: Integrate Janet/Pommaret basis codeIn Progress2015-02-11

History

#1 Updated by Anna Maria Bigatti over 12 years ago

  • Status changed from New to Resolved

#2 Updated by Anna Maria Bigatti over 12 years ago

  • Status changed from Resolved to In Progress

#3 Updated by Anna Maria Bigatti about 10 years ago

  • Target version set to CoCoALib-0.99533 Easter14

#4 Updated by John Abbott about 10 years ago

  • Target version changed from CoCoALib-0.99533 Easter14 to CoCoALib-1.0

#5 Updated by John Abbott about 9 years ago

Here is an example I found on the internet; it uses GNU make's VPATH facility:

vpath %.cpp ../src

src = Foo.cpp Bar.cpp 
test_src = Main.cpp FooTest.cpp BarTest.cpp 

objects = $(patsubst %.cpp,obj/%.o,$(src)) 
test_objects = $(patsubst %.cpp,obj/%.o,$(test_src)) 

$(objects): | obj

obj:
  @mkdir -p $@

obj/%.o : %.cpp
  @echo $< 
  @$(CXX) $(CXXFLAGS) -c $< -o $@

Posting here to keep this example in an archive.

NOTE JAA continues to be a little uneasy about using features present only in GNU make (despite the fact that JAA thinks "make" is pretty horrible)

#6 Updated by John Abbott about 9 years ago

Right now I do not recall why we think it is a good idea to have all object files in a single directory.

Pro:
  • easy to tell which object files are newer than libcocoa.a
  • any name clashes between object files ought to be more evident (maybe? not entirely sure)
  • some other (open source) projects do it this way
Con:
  • not easy to achieve with classical make files

Would it be easy to do this with some other make program (such as cmake)?

#7 Updated by John Abbott over 3 years ago

Do we really want to overhaul the current Makefile structure?
I do not recall any problems lately, and am loath to delve too much into the esoterics of make.
As I recall, the Makefile for Frobby does some "esoteric" stuff (i.e. I don't know how it works).

Right now, I'd be more inclined to invest effort into moving to cmake rather than to try to make standard make do acrobatics.

PS this issue was opened 9 years ago; the last comment was 5 years ago. And there are no substantial comments.

#8 Updated by John Abbott over 3 years ago

  • Status changed from In Progress to Rejected
  • Target version changed from CoCoALib-1.0 to CoCoALib-0.99800
  • % Done changed from 40 to 100
  • Estimated time changed from 20.00 h to 1.01 h

What we have currenyl works well enough (most of the time), and has been stable for quite a while (at least 3 years).
If it aint broke....

Let sleeping dogs lie...

Rejected; the original idea was good, but portable realization was tricky.

Also available in: Atom PDF