Ich habe zwei Makefiles, jedoch möchte ich idealerweise eines mit den Effekten haben, ein Programm (test.cpp) in Ubuntu zu kompilieren.Wie kann ich zwei separate Makefiles kombinieren, um ein Programm zu kompilieren?
Erste (für Basler Pylon5 Kamera SDK):
# Makefile for Basler pylon sample program
.PHONY: all clean
# The program to build
NAME := test
# Installation directories for pylon
PYLON_ROOT ?= /opt/pylon5
# Build tools and flags
LD := $(CXX)
CPPFLAGS := $(shell $(PYLON_ROOT)/bin/pylon-config --cflags)
CXXFLAGS := #e.g., CXXFLAGS=-g -O0 for debugging
LDFLAGS := $(shell $(PYLON_ROOT)/bin/pylon-config --libs-rpath)
LDLIBS := $(shell $(PYLON_ROOT)/bin/pylon-config --libs)
# Rules for building
all: $(NAME)
$(NAME): $(NAME).o
$(LD) $(LDFLAGS) -o [email protected] $^ $(LDLIBS)
$(NAME).o: $(NAME).cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o [email protected] $<
clean:
$(RM) $(NAME).o $(NAME)
Zweite (für OpenCV):
# The program to build
NAME := test
CFLAGS = `pkg-config --cflags opencv`
LIBS = `pkg-config --libs opencv`
$(NAME) : $(NAME).cpp
g++ -o [email protected] $< $(CFLAGS) $(LIBS)
Ist das möglich? Ich bin sehr neu in Makefiles und ich versuche nur einige Bilder mit einer Kamera zu erfassen und zu verarbeiten. Jede Hilfe wird geschätzt. Vielen Dank.
Diese beiden Makefiles machen * zwei verschiedene Dinge *. Ich nehme an, du könntest sie nacheinander ausführen ('make -f makefileName1; -f makefileName2'), aber es gibt keinen magischen Befehl, um dem Computer zu sagen" tu, was ich möchte, wenn ich wüsste, was diese Dinge tatsächlich tun ". – Beta