help-make
[Top][All Lists]
Advanced

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

Makefile C vs C++


From: Hernán F . B .
Subject: Makefile C vs C++
Date: Mon, 17 Sep 2012 21:25:53 +0200

Hi everyone,
I'm new in this list. I hope you could help me with this problem.
I'm trying to include in an ANSI C project, some (OpenCV) libraries made in
c++.
Basically people told me to change the compiler to the g++, but the
makefile of this project is quite unusual for my experience in makefiles,
and I don't find out what macro to change. It uses some standard make
variables like MAKECMDGOALS and MAKE (which calls recursively makefile).
Here is the main part of the make file (without the macro's declaration):

.PHONY: $(TARGET) build_libs

all: build_libs $(TARGET)

$(TARGET):
    @$(MAKE) -C $(SDK_PATH)/VP_SDK/Build $(TMP_SDK_FLAGS) $(SDK_FLAGS)
$(MAKECMDGOALS) USE_LINUX=yes
    mv $(ARDRONE_TARGET_DIR)/ardrone_testing_tool $(TARGET)
    mv $(TARGET) $(ARDRONE_TARGET_DIR)/

$(MAKECMDGOALS): build_libs
    @$(MAKE) -C $(SDK_PATH)/VP_SDK/Build $(TMP_SDK_FLAGS) $(SDK_FLAGS)
$(MAKECMDGOALS) USE_LINUX=yes

build_libs:
    @$(MAKE) -C $(SDK_PATH)/Soft/Build $(TMP_SDK_FLAGS) $(SDK_FLAGS)
$(MAKECMDGOALS) USE_LINUX=yes


I have read some makefile (that I didn't find right now) which made
something like

.o : < .c files>
      gcc <flags and libs> ...
.o : < .cpp files>
      g++ <flags and libs> ...

But honestly what I didn't understand quite well the way the makefile of
this project works.

Thank You very much in advance for your help,

Hernán F.B.


reply via email to

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