[C/C++]_[从netbeans里提取的通用构建C++项目的Makefile文件] (七)

2014-11-24 01:33:00 · 作者: · 浏览: 11
"Makefile Usage:"
@echo " make [CONF=] [SUB=no] build"
@echo " make [CONF=] [SUB=no] clean"
@echo " make [SUB=no] clobber"
@echo " make [SUB=no] all"
@echo " make help"
@echo ""
@echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
@echo " also build subprojects."
@echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
@echo " also clean subprojects."
@echo "Target 'clobber' will remove all built files from all configurations and,"
@echo " unless 'SUB=no', also from subprojects."
@echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
@echo " also build subprojects."
@echo "Target 'help' prints this message."
@echo ""


Makefile-Debug.mk 往里添加编译文件和编译链接参数,如果是Release,添加一个Makefile-Release.mk文件,把Debug替换为Release即可。

[plain] view plaincopyprint #
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.


# Environment
MKDIR=mkdir
CP=cp
GREP=grep
NM=nm
CCADMIN=CCadmin
RANLIB=ranlib
CC=gcc.exe
CCC=g++.exe
CXX=g++.exe
FC=gfortran.exe
AS=as.exe

# Macros
CND_PLATFORM=MinGW-Windows
CND_CONF=Debug
CND_DISTDIR=dist

# Include project Makefile
include Makefile

# Object Directory
OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}

# Object Files
OBJECTFILES= \
${OBJECTDIR}/src/my_app.o \
${OBJECTDIR}/src/my_frame.o

# C Compiler Flags
CFLAGS=

# CC Compiler Flags
CXXFLAGS=-D_LARGEFILE_SOURCE=unknown -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXMSW__ -mthreads -m32 -Wall -MMD -MP -MF $@.d
CPPFLAGS=\
-IE:/software/Lib/gui/wxWidgets-2.9.2/include \
-IE:/software/Lib/gui/wxWidgets-2.9.2/win32/release/share/include \
-Iinclude

# Fortran Compiler Flags
FFLAGS=

# Assembler Flags
ASFLAGS=

# Link Libraries and Options
LDLIBSOPTIONS= \
-Wl,--subsystem,windows -mwindows \
-LE:/software/Lib/gui/wxWidgets-2.9.2/win32/release/share \
-lwx_mswu_adv-2.9 -lwx_mswu_core-2.9 -lwx_baseu-2.9 \
build/style.o


# Build Targets
.build-conf: ${BUILD_SUBPROJECTS}
"${MAKE}" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/test_wx.exe

dist/Debug/MinGW-Windows/test_wx.exe: ${OBJECTFILES}
${MKDIR} -p dist/Debug/MinGW-Windows
${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/test_wx -Wl,-s ${OBJECTFILES} ${LDLIBSOPTIONS}

${OBJECTDIR}/src/my_app.o: src/my_app.cpp
${MKDIR} -p ${OBJECTDIR}/src
${RM} $@.d
$(COMPILE.cc) -o ${OBJECTDIR}/src/my_app.o src/my_app.cpp

${OBJECTDIR}/src/my_frame.o: src/my_frame.cpp
${MKDIR} -p ${OBJECTDIR}/src
${RM} $@.d
$(COMPILE.cc) -o ${OBJECTDIR}/src/my_frame.o src/my_frame.cpp

# Subprojects
.build-subprojects:

# Clean Targets
.clean-conf: ${CLEAN_SUBPROJECTS}
${RM} -r build/Debug
${RM} dist/Debug/MinGW-Windows/test_wx.exe

# Subprojects
.clean-subprojects:

# Enable dependency checking
.dep.inc: .depcheck-impl

include .dep.inc

#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specifi