我发布的以下make文件用于cpp,我想在同一个Makefile中编译2个c文件并将其与cpp目标文件链接。我该怎么做,请指导在下面的 make 文件中构造 Ex:我想添加 2 个 c 文件 file1.c file1.h、file2.c 和 file2.h
如何在下面的 Makefile 中添加它。
生成文件
EXENAME = demo
CPPS += \
main.cpp\
features.cpp
CPP_DEPS += \
main.d\
features.d
OBJS += \
main.o\
features.o
INCLUDEPATH = -I.
COMPILEOPTS = -O3 -c -fPIC -MP -w -MMD -c $(INCLUDEPATH)
RPATHOPTS = -Wl,-rpath="."
LIBOPTS = -L. -lEIddk2000\
-lpthread
LINKOPTS = -Wl -o "$(EXENAME)"
############################################################
## TOOLCHAIN PATH CONFIGURATION ############################
## User should modify here ############################
TOOLCHAIN_GCC = /home/root/Desktop/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc
TOOLCHAIN_LIBS += -L/home/root/Desktop/arm-compiler/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/lib
## TOOLCHAIN PATH CONFIGURATION END ########################
############################################################
all: $(EXENAME)
$(EXENAME): $(OBJS)
@echo "Linking..."
$(TOOLCHAIN_GCC) $(TOOLCHAIN_LIBS) $(LINKOPTS) $(OBJS) $(LIBOPTS) $(RPATHOPTS)
@echo "Done."
@echo ""
%.o : %.cpp
$(TOOLCHAIN_GCC) $(COMPILEOPTS) $<
clean :