c mysql makefile_C/C++ 编写一个通用的Makefile 来编译.c .cpp 或混编

1.虽然能编译出程序,但是会提示错误。目前暂未解决

make: sinclude: Command not found

make: *** [test] Error 127

2. 后续主要要修改的部分:

1> PROGRAM := hello # 设置运行程序名

2> SRCDIRS := .  # 源程序位于当前目录下

3> SRCEXTS := .c .cpp  # 源程序文件有 .c 和 .cpp 两种类型

4> CFLAGS := -g # 为 c 目标程序包含 gdb 调试信息

5> CPPFLAGS := -g # 为 c++ 目标程序包含 gdb 调试信息

3. Makefile文件

#############################################################

# Generic Makefile for C/C++ Program

#

# License: GPL (General Public License)

# Author: whyglinux

# Date: 2006/03/04 (version 0.1)

# 2007/03/24 (version 0.2)

# 2007/04/09 (version 0.3)

# 2007/06/26 (version 0.4)

# 2008/04/05 (version 0.5)

#

# Description:

# ------------

# This is an easily customizable makefile template. The purpose is to

# provide an instant building environment for C/C++ programs.

#

# It searches all the C/C++ source files in the specified directories,

# makes dependencies, compiles and links to form an executable.

#

# Besides its default ability to build C/C++ programs which use only

# standard C/C++ libraries, you can customize the Makefile to build

# those using other libraries. Once done, without any changes you can

# then build programs using the same or less libraries, even if source

# files are renamed, added or removed. Therefore, it is particularly

# convenient to use it to build codes for experimental or study use.

#

# GNU make is expected to use the Makefile. Other versions of makes

# may or may not work.

#

# Usage:

# ------

# 1. Copy the Makefile to your program directory.

# 2. Customize in the "Customizable Section" only if necessary:

# * to use non-standard C/C++ libraries, set pre-processor or compiler

# options to and linker ones to

# (See Makefile.gtk+-2.0 for an example)

# * to search sources in more directories, set to

# * to specify your favorite program name, set to

# 3. Type make to start building your program.

#

# Make Target:

# ------------

# The Makefile provides the following targets to make:

# $ make compile and link

# $ make NODEP=yes compile and link without generating dependencies

# $ make objs compile only (no linking)</

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值