summary refs log tree commit diff stats
path: root/tools/niminst/buildbat.tmpl
blob: 11fa97a5a0e1f8cb6bf19a806de042d797abd3d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#! stdtmpl(subsChar='?') | standard
#proc GenerateBuildBatchScript(c: TConfigData, target: TTarget): string = 
#  result = "@echo off\nREM Generated by niminst\n"
SET CC=gcc
SET LINKER=gcc
SET COMP_FLAGS=?{c.ccompiler.flags}
SET LINK_FLAGS=?{c.linker.flags}

REM call the compiler:

#  block win32:
#    var linkCmd = ""
#    for ff in items(c.cfiles[1][ord(target)]):
#      let f = ff.replace('/', '\\')
ECHO %CC% %COMP_FLAGS% -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}
%CC% %COMP_FLAGS% -Ibuild -c ?{f} -o ?{changeFileExt(f, "o")}
#      linkCmd.add(" " & changeFileExt(f, "o"))
#    end for

ECHO %LINKER% %LINK_FLAGS% -o ?{firstBinPath(c)\toLower(c.name)}.exe ?linkCmd
%LINKER% %LINK_FLAGS% -o ?{firstBinPath(c)\toLower(c.name)}.exe ?linkCmd

#  end block

ECHO SUCCESS