Thread (3 messages) flat view 3 messages, 2 authors, 2007-01-25

[Buildroot] Make problems

From: Nathanael D. Noblet <hidden>
Date: 2007-01-25 16:50:29

Kleegrewe, Christian wrote:
And my hello.mk File

#############################################################
#
# Any custom stuff you feel like doing....
#
#############################################################
HELLO_DIR=package/hello
HELLO_SOURCE_DIR=$(HOME)/embedded_p2p/hello
HELLO=hello
HELLO_BINARY=hello

$(HELLO):
        -cp -af $(HELLO_SOURCE_DIR)/* $(HELLO_DIR)/
        touch $@
        touch -c $(HELLO_DIR)/hello.cpp

$(HELLO_DIR)/$(HELLO_BINARY): $(HELLO_DIR)/hello.cpp $(HELLO_DIR)
        $(MAKE) CFLAGS="$(TARGET_CFLAGS)" DEBUG=true KLIBC=false \
            KERNEL_INCLUDE_DIR=$(STAGING_DIR)/include \
            TARGET_DIR=$(TARGET_DIR) -C $(HELLO_SOURCE_DIR) -o 
$(HELLO_BINARY);
if you look at other makefiles in buildroot, you'll see usually the last 
line (though position isn't important)

programname: $(PROGRAM_DIR)/$(TARGET_BINARY) ....

make deals with dependancies and dependency trees, so the line is like so

target: dependancy1 dependancy2
      tasks for target
      tasks for target

dependancy1: dependancy3
     tasks for dependency1

dependancy2:
    tasks for dependency2

dependancy3:
    tasks for dependency3


if I used this makefile directly and did `make target` I would get
tasks for dependency3
tasks for dependency1
tasks for dependency2
tasks for target

so with your makefile, you've made the end target of program name = 
hello, the only thing to run. In your
ifeq ($(strip $(BR2_PACKAGE_HELLO)),y)
TARGETS+=hello
Endif

hello: is added as a target, but your makefile has hello: as a 
dependency free target. it does the first part, but that is it. so 
change it so it is something like
$(HELLO_DIR):
    mkdir $(HELLO_DIR)

$(HELLO_DIR)/hello.cpp: $(HELLO_DIR)
    tasks including your touch $HELLO_DIR/hello.cpp

$(HELLO_DIR)/$(HELLO_BINARY): $(HELLO_DIR)/hello.cpp
       tasks...

hello: $(HELLO_DIR)/$(HELLO_BINARY)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help