forked from schnaader/precomp-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakeprof.bat
67 lines (63 loc) · 2.36 KB
/
makeprof.bat
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@echo off
REM Script for compiling profile versions
REM Usage:
REM "makeprof" for a 32-bit profile version
REM "makeprof 64" for a 64-bit profile version (you might have to adjust GCC64 and GPP64 to your environment)
REM To analyze a profile, run "gprof -b precomp64_prof.exe gmon.out"
REM gcc/g++ 32-bit/64-bit commands - change them according to your environment
set GCC32=gcc
set GPP32=g++
set GCC64=gcc
set GPP64=g++
set EXE2=
set MPARAM=-march=pentiumpro
set GCC=%GCC32%
set GPP=%GPP32%
if "%1%"=="64" (
set GCC=%GCC64%
set GPP=%GPP64%
set EXE2=64
set MPARAM=-march=x86-64 -m64
)
set GIF=contrib\giflib\gifalloc.c contrib\giflib\gif_err.c contrib\giflib\dgif_lib_gcc.c contrib\giflib\egif_lib_gcc.c
set BZIP=contrib\bzip2\bzlib.c contrib\bzip2\blocksort.c contrib\bzip2\crctable.c contrib\bzip2\compress.c contrib\bzip2\decompress.c contrib\bzip2\huffman.c contrib\bzip2\randtable.c
set ZLIB=contrib\zlib\adler32.c contrib\zlib\crc32.c contrib\zlib\zutil.c contrib\zlib\trees.c contrib\zlib\inftrees.c contrib\zlib\inffast.c contrib\zlib\inflate.c contrib\zlib\deflate.c
set ZLIB_O=adler32.o crc32.o zutil.o trees.o inftrees.o inffast.o inflate.o deflate.o
set JPG=aricoder.o bitops.o packjpg.o
SET MP3=packmp3.o huffmp3.o
%GCC% %MPARAM% -c -O2 -pg -Wno-attributes %ZLIB%
pushd contrib\packjpg
%GPP% %MPARAM% -c -O3 -pg -DBUILD_LIB -Wall -pedantic -funroll-loops -ffast-math -fsched-spec-load aricoder.cpp bitops.cpp packjpg.cpp
if exist ..\..\aricoder.o del ..\..\aricoder.o
if exist ..\..\bitops.o del ..\..\bitops.o
if exist ..\..\packjpg.o del ..\..\packjpg.o
move aricoder.o ..\..\ > nul
move bitops.o ..\..\ > nul
move packjpg.o ..\..\ > nul
popd
pushd contrib\packmp3
copy ..\packjpg\aricoder.* > nul
copy ..\packjpg\bitops.* > nul
%GPP% %MPARAM% -c -O3 -pg -DBUILD_LIB -Wall -pedantic -funroll-loops -ffast-math -fsched-spec-load aricoder.cpp bitops.cpp huffmp3.cpp packmp3.cpp
move huffmp3.o ..\..\ > nul
move packmp3.o ..\..\ > nul
if exist aricoder.* del aricoder.*
if exist bitops.* del bitops.*
popd
%GPP% %MPARAM% -static -static-libgcc -static-libstdc++ -Wall -pg precomp.cpp %JPG% %MP3% %GIF% %BZIP% %ZLIB_O% -O2 -oprecomp%EXE2%_prof.exe
if not %ERRORLEVEL% == 0 echo ERROR!!!
if %ERRORLEVEL% == 0 echo.
if %ERRORLEVEL% == 0 echo Build successful.
set ZLIB_O=
set ZLIB=
set BZIP=
set GIF=
set JPG=
set GPP=
set GCC=
set GPP32=
set GCC32=
set GPP64=
set GCC64=
set EXE2=
set MPARAM=