Advertisement

Makefile question (another Q)

Started by May 11, 2003 05:02 AM
4 comments, last by stefu 21 years, 5 months ago
How do I change to another directory and call another make to build library before this make? I tried:

gamelib:
    cd ../gamelib
    make
  
But this calls this makefile recursively instead of makefile at ../gamelib Visit [edited by - stefu on May 11, 2003 6:04:23 AM] [edited by - stefu on May 11, 2003 10:00:34 AM]
O yeah

cd ../gamelib && make
Advertisement
You could also use

make -C directory target

cu,
Prefect
Widelands - laid back, free software strategy
Goo da!!
I also found how to use automatic dependecies!


Visit
Another question:

If I have:
SOURCES = main.cpp car_phy.cpp track.cpp

how do I get list of object files with src/ in front, like this:
OBJS = $(SOURCES:.cpp=.o)

but result should be:
OBJS = obj/main.o obj/car_phy.o obj/track.o


Visit

[edited by - stefu on May 11, 2003 10:01:13 AM]
@echo $(foreach CPP_SRC,$(CPP_SRC),$(SRC_DIR)$(CPP_SRC))

This topic is closed to new replies.

Advertisement