0

I'm trying to modify a makefile to cross-compile binaries. The command in question is below:

# GNU Make solution makefile autogenerated by Premake
# Type "make help" for usage help



ifndef config
  config=debug
endif
export config

PROJECTS := json openjaus openjaus-core openjaus-environment openjaus-mobility openjaus-manipulator openjaus-ugv Base Managed PingTest LargeMessageTest PdDemo GposDemo   GposClientDemo StillImageSensorDemo StillImageClientDemo

.PHONY: all clean help $(PROJECTS)

all: $(PROJECTS)

json:   
    @echo "==== Building json ($(config)) ===="
    @${MAKE} --no-print-directory -C .build -f json.make

As can be seen the makefile has several targets. They all have the same structure as the 'json' target. The command in question in question is

@${MAKE} --no-print-directory -C .build -f json.make

The '${MAKE}' variable = make (I have verified this with echo) What does the -C do? What does the .build do? I'm good with -f json.make

Also, when I run make the json.make file gets created compiles file and deletes it self, so I do not have access to that file.

The error I receive when I modify the command in question is

==== Building json (debug) ====
make[1]: Nothing to be done for `/home/botbear/openwrt/trunk/staging_dir/toolchain-    arm_v6k_gcc-linaro_uClibc-0.9.32_eabi/bin/arm-openwrt-linux-c++'.

The command after modifications looks like:

@${MAKE} /home/botbear/openwrt/trunk/staging_dir/toolchain-arm_v6k_gcc-linaro_uClibc-0.9.32_eabi/bin/arm-openwrt-linux-c++ --no-print-directory -C .build -f json.make

Any help is appreciated!

1

2 Answers 2

0

you can use man make to understand the parameters for make:

-C dir, --directory=dir
        Change to directory dir before reading the makefiles or doing any-
        thing else.  If multiple -C options are specified, each is  inter-
        preted  relative to the previous one: -C / -C etc is equivalent to
        -C /etc.  This is typically used  with  recursive  invocations  of
        make.

-f file, --file=file, --makefile=FILE
        Use file as a makefile.

so -C .build changes to the directory .build.

and i don't understand the part of your question about modifying the command.

Sign up to request clarification or add additional context in comments.

Comments

0

Try to find where json.make lives. It seems that it's that makefile which creates & deletes the directory you were talking about.

From the command line it seems that make changes directory to .build and executes the json.make. Not sure how json.make ends up there. Is .build the directory which is created and then deleted?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.