[jamming] Newbie question

Mihai Christodorescu mihai at cs.wisc.edu
Thu Nov 18 12:32:39 PST 2004


I have the following directory structure:

src/ - source files and subdirectories with source files
obj/ - object files
lib/ - library file
bin/ - executable file

What I want to do is to compile files from src/ (and subdirectories), put 
the resulting object files under obj/ (and under corresponding 
subdirectories), and create a library from those object files and an executable.

src/dir1/a.cpp -> obj/dir1/a.o
src/dir2/a.cpp -> obj/dir2/a.o
src/c.cpp -> obj/c.o
src/main/b.cpp -> obj/main/b.cpp

obj/dir1/a.o + obj/dir2/a.o + obj/c.o -> lib/libx.a

lib/libx.a + obj/main/b.cpp -> bin/main

I managed to put all object files in obj/ by using LOCATE_TARGET. I also 
managed to put the resulting executable (main) in bin/ by using LOCATE on 
... . Unfortunately, the resulting library (libx.a) is put in obj/ (as 
specified by LOCATE_TARGET).

My questions:

1. Can I achieve the directory layout shown above with the Jambase rules?

2. How can I replace a substring in a string?
    (regexp not needed, I just want to say replace "blah" with "foo" in
    "AblahC", to obtain "AfooC").

Thanks,

Mihai

-- 
  - mihai at cs.wisc.edu - http://www.cs.wisc.edu/~mihai -
-------------------------------------------------------
   The man of knowledge must be able not only to love
  his enemies but also to hate his friends.
                                  - Friedrich Nietzsche
-------------------------------------------------------
     -- Feed the machine that burns in your head. --



More information about the jamming mailing list