VC makefile 编译

开始->程序 -> Microsoft Visual Studio 2005 -> Visual Studio Tools -> Visual Studio 2005 命令提示

进入后命令模式后,转换到工程目录下输入 nmake (保证此目录下有 makefile).

 

以下是简单的makefile 样本:

# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
# ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
# PARTICULAR PURPOSE.
#
# Copyright (C) 1993 - 1996  Microsoft Corporation.  All Rights Reserved.
#
#
# Processor independent makefile

# Nmake macros for building Windows 32-Bit apps
!include <win32.mak>

PROJ = MTTTY

all: $(PROJ).exe

# Define project specific macros
PROJ_OBJS  =    about.obj error.obj \
  init.obj mttty.obj \
  reader.obj readstat.obj \
  settings.obj status.obj \
  transfer.obj writer.obj \
  MyDialog.obj
STD_LIBS   =    libcmt.lib kernel32.lib \
  user32.lib gdi32.lib \
  comdlg32.lib
EXTRA_LIBS =    winmm.lib comctl32.lib
GLOBAL_DEP =    mttty.h ttyinfo.h
RC_DEP     =    resource.h mttty.ico \
  mttty2.ico mttty3.ico \
  mttty4.ico

# Inference rule for updating the object files
.c.obj:
  $(cc) $(cdebug) /MT $(cflags) $(cvars) $*.c

# Build rule for resource file
$(PROJ).res: $(PROJ).rc $(RC_DEP)
    $(rc) $(rcflags) $(rcvars) /fo $(PROJ).res $(PROJ).rc

# Build rule for EXE
$(PROJ).EXE: $(PROJ_OBJS) $(PROJ).res
    $(link) $(linkdebug) $(guilflags) \
    $(PROJ_OBJS) $(PROJ).res $(STD_LIBS) $(EXTRA_LIBS) \
    -out:$(PROJ).exe


# Rules for cleaning out those old files
clean:
    del *.bak
    del *.pdb
    del *.obj
    del *.res
    del *.exp
    del *.map
    del *.sbr
    del *.bsc

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值