window下通过makefile 文件编译C\C++源文件(Scintilla的windows例子)
scintilla下载下来的例子:dmapp
所带4文件,一个空文件夹(无用好像):
resource.h
DMApp.cxx
DMApp.rc
makefile_vc
其中
makefile_vc的文件内容:
/////////////////////////////////////////////////////////////////////////
# Make file for DMApp, a small demonstration application
# for the SciLexer DLL.
# This file should be in a directory which is a peer of the scintilla
# directory so Scintilla.h and SciLexer.h files can be found
CC = cl
RC = rc
LD = link
O = obj
PROGDEMO = DMApp.EXE
ALL: $(PROGDEMO)
clean:
del /q *.exe *.obj *.res
LDFLAGS = /NODEFAULTLIB:LIBC KERNEL32.lib USER32.lib GDI32.lib COMDLG32.lib WINMM.lib COMCTL32.lib ADVAPI32.lib IMM32.lib SHELL32.LIB OLE32.LIB
CXXFLAGS = /TP /MD /Ox
!IFDEF DEBUG
CXXFLAGS=$(CXXFLAGS) /Zi
LDFLAGS=/DEBUG $(LDFLAGS)
!ENDIF
.cxx.$(O):
$(CC) /I ..\scintilla\include $(CXXFLAGS) -c $*.cxx -o $@
.rc.res:
$(RC) $*.rc
DMApp.o: Scintilla.h SciLexer.h resource.h
$(PROGDEMO): DMApp.obj DMApp.res
$(LD) DMApp.obj DMApp.res $(LDFLAGS)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
其中..\scintilla\include为scintilla包含的头文件所在目录
接下来
制作编译处理文件 run.bat
---------------------------------
nmake -f makefile_vc LINK_LIB="SciLexer.lib"
PAUSE
@set PATH=/; %path%
error_printer | tee2.5.exe result.rst
PAUSE
-----------------------------
其中 makefile_vc 为makefile的文件名, SciLexer.lib 为所需要的库,如果包含多个库可以设置成路径目录
运行run.bat编译结果:
--------------------------------------------------------------------------
F:\dmapp>nmake -f makefile_vc LINK_LIB="SciLexer.lib"
Microsoft (R) Program Maintenance Utility Version 6.00.9782.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
cl /I inc /TP /MD /Ox -c DMApp.cxx -o DMApp.obj
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
DMApp.cxx
rc DMApp.rc
link DMApp.obj DMApp.res /NODEFAULTLIB:LIBC KERNEL32.lib USER32.lib GDI3
2.lib COMDLG32.lib WINMM.lib COMCTL32.lib ADVAPI32.lib IMM32.lib SHELL32.LIB OLE
32.LIB
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
F:\dmapp>PAUSE
请按任意键继续. . .
---------------------------------
good !
原创文章:版权所有,转载请注明转载中国研发网:http://www.yanfaw.com
本站所有文章欢迎任何形式的转载,但请注明作者及出处,尊重他人劳动成果!
文章转载自:中国研发网 [http://www.yanfaw.com]
本文标题:window下通过makefile 文件编译C\C++源文件(Scintilla的windows例子)
文章转载自:中国研发网 [http://www.yanfaw.com]
本文标题:window下通过makefile 文件编译C\C++源文件(Scintilla的windows例子)










