Este código $(PRGS:.prg=.obj) significa: En la lista de PRGS reemplaza .prg con .obj. Como podeis ver se usa esta técnica en varias partes del makefile.
Disfrutadlo!
go.bat
- Code: Select all Expand view
- @set oldpath=%path%
@set oldinclude=%include%
@set oldlib=%lib%
@set oldlibpath=%libpath%
if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" call "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
c:\"Program Files (x86)\Microsoft Visual Studio 12.0"\VC\bin\nmake -fMyApp.mak
@set path=%oldpath%
@set include=%oldinclude%
@set lib=%oldlib%
@set libpath=%oldlibpath%
@set oldpath=""
@set oldinclude=""
@set oldlib=
@set oldlibpath=
if errorlevel==0 MyApp.exe
MyApp.mak
- Code: Select all Expand view
- #Microsoft VS2013 make sample, (c) FiveTech Software 2014
HBDIR=c:\harbour
FWDIR=c:\fwh
VCDIR="c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC"
SDKDIR="c:\Program Files (x86)\Windows Kits\8.1"
PRGS = \
one.prg \
two.prg \
three.prg \
four.prg
#place here as many PRGs as needed
.SUFFIXES: .prg .c .obj .rc .res
MyApp.exe : $(PRGS:.prg=.obj) MyApp.res
echo $(PRGS:.prg=.obj) > msvc.tmp
echo $(FWDIR)\lib\FiveH32.lib $(FWDIR)\lib\FiveHC32.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbrtl.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbvm.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\gtgui.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hblang.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbmacro.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbrdd.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\rddntx.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\rddcdx.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\rddfpt.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbsix.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbdebug.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbcommon.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbpp.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbwin.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbcplr.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\xhb.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbpcre.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbct.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbcpage.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\hbzlib.lib >> msvc.tmp
echo $(HBDIR)\lib\vc32\png.lib >> msvc.tmp
echo kernel32.lib >> msvc.tmp
echo user32.lib >> msvc.tmp
echo gdi32.lib >> msvc.tmp
echo winspool.lib >> msvc.tmp
echo comctl32.lib >> msvc.tmp
echo comdlg32.lib >> msvc.tmp
echo advapi32.lib >> msvc.tmp
echo shell32.lib >> msvc.tmp
echo ole32.lib >> msvc.tmp
echo oleaut32.lib >> msvc.tmp
echo uuid.lib >> msvc.tmp
echo odbc32.lib >> msvc.tmp
echo odbccp32.lib >> msvc.tmp
echo iphlpapi.lib >> msvc.tmp
echo mpr.lib >> msvc.tmp
echo version.lib >> msvc.tmp
echo wsock32.lib >> msvc.tmp
echo msimg32.lib >> msvc.tmp
echo oledlg.lib >> msvc.tmp
echo psapi.lib >> msvc.tmp
echo gdiplus.lib >> msvc.tmp
echo winmm.lib >> msvc.tmp
IF EXIST MyApp.res echo MyApp.res >> msvc.tmp
link @msvc.tmp /nologo /subsystem:windows /NODEFAULTLIB:msvcrt > link.log
@type link.log
@del $(PRGS:.prg=.obj)
$(PRGS:.prg=.obj) : $(PRGS:.prg=.c)
$(PRGS:.prg=.c) : $(PRGS)
MyApp.res : MyApp.rc
rc.exe -r -d__FLAT__ MyApp.rc
.prg.c:
$(HBDIR)\bin\harbour $< /n /i$(FWDIR)\include;$(HBDIR)\include
.c.obj:
cl.exe -c -TC -W3 -I$(HBDIR)\include -I$(SDKDIR)\include -I$(VCDIR)\include $<