VC makefile 编译

来源:互联网 发布:vscode调整字体大小 编辑:程序博客网 时间:2024/06/06 10:44

开始->程序 -> 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

 

 

原创粉丝点击