1.有了这个配置文件,你可以用任何ide或文本编辑器,除了不支持makefile的ide。
2.makefile的好处不用说吧,不依赖ide,如果g++或ide更新了的话makefile什么都不需要做。但是基于项目文件的编译配置就难了,比如vs2010项目如果想用vs2005编译的话。。。。
3.makefile从编译到链接选项都可以自己控制。
4个文件,当然有时间的话也可以自己改改减少数量,自己删除注释吧。
主 Makefile,放在项目根目录下.
[plain]
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_PLATFORM_${CONF} platform name (current configuration)
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL
# Environment
MKDIR=mkdir -p
CP=cp
CCADMIN=CCadmin
# build
build: .build-init .build-post
.build-init:
.build-pre:
# Add your pre 'build' code here...
windres --input-format=rc -O coff -i resources/style.rc -o build/style.o --define __WXMSW__ --include-dir E:/software/Lib/gui/wxWidgets-2.9.2/include
.build-post: .build-impl
# Add your post 'build' code here...
${CP} E:/software/Lib/gui/wxWidgets-2.9.2/win32/release/share/wxmsw292u_adv_gcc_custom.dll dist/Debug/MinGW-Windows/
${CP} E:/software/Lib/gui/wxWidgets-2.9.2/win32/release/share/wxmsw292u_core_gcc_custom.dll dist/Debug/MinGW-Windows/
${CP} E:/software/Lib/gui/wxWidgets-2.9.2/win32/release/share/wxbase292u_gcc_custom.dll dist/Debug/MinGW-Windows/
${CP} E:/software/MinGW/bin/libgcc