forked from diegocr/netcat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makewin.cmd
executable file
·43 lines (34 loc) · 1.05 KB
/
makewin.cmd
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@REM Build script to compile Netcat on WIN32 using MinGW
@REM
@REM Rodney Beede (http://www.rodneybeede.com)
@REM
@REM 2009-09-02
@REM
@REM Tested with gcc 3.4.5 and MinGW version 5.1.4
@REM
@REM [[ diegocr ]]
@REM
@REM 2010-12-14
@REM
@REM Tested with gcc 4.5.0 and MinGW version 3.1.8(?)
@REM Added more compiler options and strip usage
@echo off
SET PROGRAM=nc.exe
SET PCOPY=COPY /Y %PROGRAM% c:\windows\system32
SET COMPILER=c:\MinGW\bin\gcc.exe
SET STRIP=c:\MinGW\bin\strip.exe
SET LIB_DIR=c:\MinGW\lib
@REM not needed? SET CFLAGS=-c -DWIN32 -DNDEBUG -D_CONSOLE -DTELNET
SET XFLAGS=-O3 -march=i686
SET CFLAGS=-c %XFLAGS% -DTELNET
SET LFLAGS=%XFLAGS%
del *.o
del nc.exe
"%COMPILER%" %CFLAGS% getopt.c
"%COMPILER%" %CFLAGS% doexec.c
"%COMPILER%" %CFLAGS% netcat.c
@REM Note that the -l libraries MUST come at the very end or linking will fail
"%COMPILER%" getopt.o doexec.o netcat.o -o %PROGRAM% %LFLAGS% -Wl,-L"%LIB_DIR%",-lkernel32,-luser32,-lwinmm,-lws2_32
"%STRIP%" -s %PROGRAM%
%PCOPY%
echo Operation Completed