bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Make error


From: spai
Subject: Make error
Date: Wed, 26 Nov 2003 14:53:20 -0800

I like the idea of using implicit rules
to do all the work. With that objective, is there an elegant
way to do than doing it as follow:

bld_dir = ../obj
$(bld_dir)/%.o: %.cpp
        $(COMPILE.cpp) $(OUTPUT_OPTION) $<

The above rule above creates all the object files in ../obj directory.

However using:
$(bin_dir)/%: %.cpp
        $(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@

gives the following error.
gnumake: *** No rule to make target `../bin/OneLevel_OneGlobal_SASD', needed by `build'.  Stop.
The full makefile is shown below.

# $Source$
#

SYSTEMC = /prj/vlsi/scp/osci/systemc-2.0.1
bin_dir = ../bin

# Set the default variables
CC          = g++
CXXFLAGS    = -g -Wall -Wno-deprecated
TARGET_ARCH =
CPPFLAGS    = -I$(SYSTEMC)/include \
              -I../axi

#Libraries:
LDFLAGS=-g
LDLIBS = \
        -L../lib -lqctaxicore \
        -L$(SYSTEMC)/lib-gccsparcOS5 -lsystemc -lm

target_bus_models = \
        OneLevel_OneGlobal_SASD.cpp

# Executables
TARGETS = $(target_bus_models:%.cpp=$(bin_dir)/%)

$(bin_dir)/%: %.cpp
        $(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@

# Build all targets
build: $(TARGETS)

# Clean directory
clean:
        rm -rf $(TARGETS)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]