From abd1e4da23d931302d808c1ac2ef6171ce771b70 Mon Sep 17 00:00:00 2001 From: seefo Date: Thu, 11 Jan 2018 20:52:36 -0500 Subject: [PATCH] Added basic dsrc building --- .dockerignore | 5 + build_dsrc.sh | 6 + gameserver/Dockerfile | 37 + gameserver/utils/build_node_list.sh | 23 - gameserver/utils/{ => content}/build_java.sh | 0 .../utils/{ => content}/build_java_multi.sh | 0 .../utils/{ => content}/build_java_single.sh | 0 gameserver/utils/{ => content}/build_miff.sh | 2 +- ...build_object_template_crc_string_tables.py | 2 +- .../build_quest_crc_string_tables.py | 2 +- gameserver/utils/{ => content}/build_tab.sh | 2 +- .../utils/{ => content}/build_tab_multi.sh | 0 gameserver/utils/{ => content}/build_tdf.sh | 0 gameserver/utils/{ => content}/build_tpf.sh | 0 .../utils/{ => content}/build_tpf_multi.sh | 2 +- gameserver/utils/entrypoint.sh | 15 + gameserver/utils/tools/AutomatedDailyBuild.pl | 146 + .../utils/tools/AutomatedDailyServerBuild.pl | 45 + gameserver/utils/tools/BuildChanges.pl | 86 + gameserver/utils/tools/BuildDsp.pl | 1603 +++++++++++ gameserver/utils/tools/BuildFunctions.pm | 278 ++ .../BuildLivePatchTreeFromChangelists.pl | 68 + gameserver/utils/tools/BuildVcproj.pl | 2553 +++++++++++++++++ gameserver/utils/tools/CheckPatchTreeSize.pl | 240 ++ gameserver/utils/tools/ContentSync.pl | 195 ++ gameserver/utils/tools/MoneyCheckActivity.pl | 363 +++ .../utils/tools/MoneyNamedAccountToFrom.pl | 339 +++ gameserver/utils/tools/NormalizeExcelXml.pl | 174 ++ gameserver/utils/tools/ScanScript.pl | 144 + gameserver/utils/tools/SwgClientClean.pl | 43 + gameserver/utils/tools/SwgGameServerClean.pl | 44 + gameserver/utils/tools/SwgGodClientClean.pl | 48 + gameserver/utils/tools/allClientBuildClean.pl | 46 + .../tools/assignVertexShaderConstants.pl | 147 + gameserver/utils/tools/autotest/autotest.pl | 40 + .../tools/autotest/background_process.pl | 98 + .../utils/tools/autotest/centralserver.pl | 45 + .../utils/tools/autotest/databaseserver.pl | 13 + .../utils/tools/autotest/loginserver.pl | 55 + gameserver/utils/tools/autotest/passfail.pl | 28 + .../utils/tools/autotest/planetserver.pl | 11 + .../utils/tools/autotest/serverconsole.pl | 69 + .../utils/tools/autotest/taskmanager.pl | 44 + gameserver/utils/tools/buildAllVcproj.pl | 37 + .../utils/tools/buildAppearanceTable.pl | 75 + .../utils/tools/buildAppearanceUsage.pl | 68 + .../buildAssetCustomizationManagerData.pl | 1575 ++++++++++ .../utils/tools/buildBranchBinaryLibs.sh | 153 + gameserver/utils/tools/buildCrcStringTable.pl | 168 ++ .../buildObjectTemplateCrcStringTables.pl | 138 + .../utils/tools/buildQuestCrcStringTables.pl | 120 + .../utils/tools/buildTreeFileLookupTable.pl | 53 + gameserver/utils/tools/build_bootleg_linux.pl | 691 +++++ gameserver/utils/tools/build_bootleg_win32.pl | 435 +++ .../utils/tools/build_cluster_controller.pl | 744 +++++ .../utils/tools/build_cluster_daemon.pl | 1160 ++++++++ gameserver/utils/tools/checkChunkLoading.pl | 28 + .../utils/tools/checkCreatureStrings.pl | 54 + gameserver/utils/tools/checkWritableSrc.pl | 70 + gameserver/utils/tools/check_environment.pl | 84 + .../tools/collectAssetCustomizationInfo.pl | 183 ++ gameserver/utils/tools/configFileBuilder.pl | 18 + gameserver/utils/tools/coreMemoryReport.sh | 220 ++ gameserver/utils/tools/coremail.pl | 89 + gameserver/utils/tools/crashCompare.pl | 97 + .../utils/tools/crashSummarizeLocations.pl | 96 + gameserver/utils/tools/createClientOTs.pl | 182 ++ gameserver/utils/tools/createServerOTs.pl | 166 ++ gameserver/utils/tools/custTool.pl | 367 +++ gameserver/utils/tools/custUpgrade.pl | 437 +++ gameserver/utils/tools/custView.pl | 476 +++ gameserver/utils/tools/customBuildSteps.pl | 106 + .../utils/tools/dataDirectoryDigestBuilder.pl | 121 + gameserver/utils/tools/dataLintParser.pl | 11 + gameserver/utils/tools/dependcat.pl | 19 + gameserver/utils/tools/emailDataLint.pl | 292 ++ gameserver/utils/tools/emailServerDataLint.pl | 227 ++ gameserver/utils/tools/estimatePatchSize.pl | 121 + .../tools/figureOfMeritCombatSimulator.pl | 435 +++ gameserver/utils/tools/filterWarnings.pl | 73 + .../utils/tools/findAllCollideableObjects.pl | 317 ++ .../tools/findAssetsUsingCustomization.pl | 90 + .../utils/tools/findBadSkeletonBindings.pl | 159 + .../utils/tools/find_extension_in_files.pl | 40 + gameserver/utils/tools/find_tag_in_files.pl | 40 + gameserver/utils/tools/find_unchecked.pl | 83 + .../tools/fixSourceControlIntegration.pl | 42 + .../tools/fixupClientBakedWearableData.pl | 1372 +++++++++ .../tools/formatFilteredExceptionReport.pl | 68 + .../utils/tools/gatherViewerWarnings.pl | 16 + gameserver/utils/tools/gatherWarnings.pl | 126 + .../utils/tools/getFileSizeInDirectoryTree.pl | 58 + gameserver/utils/tools/headerLint.pl | 127 + gameserver/utils/tools/inctree.pl | 120 + gameserver/utils/tools/installTimer.pl | 31 + .../utils/tools/lookupControllerMessage.sh | 7 + .../utils/tools/makeAsynchronousLoadData.pl | 177 ++ gameserver/utils/tools/makeMultiplyReport.pl | 127 + gameserver/utils/tools/mapFileLookUpWin32.pl | 64 + gameserver/utils/tools/memoryReport.pl | 74 + .../utils/tools/moveUpOrAddAttribute.pl | 189 ++ gameserver/utils/tools/newline.pl | 73 + .../tools/objectTemplateCreateCommands.pl | 84 + gameserver/utils/tools/p4FindUnchanged.pl | 48 + .../tools/p4_description_change_controller.pl | 164 ++ gameserver/utils/tools/p4_external_review.pl | 291 ++ .../utils/tools/p4_integrate_deleted.pl | 73 + gameserver/utils/tools/p4consistency.pl | 164 ++ gameserver/utils/tools/p4dos2unix | 2 + gameserver/utils/tools/p4group.pl | 22 + gameserver/utils/tools/p4tar.pl | 176 ++ gameserver/utils/tools/p4unsync.pl | 134 + gameserver/utils/tools/p4untar.pl | 430 +++ gameserver/utils/tools/patchTreeRspBuilder.pl | 66 + .../utils/tools/perllib/AppearanceTemplate.pm | 109 + .../BlueprintTextureRendererTemplate.pm | 189 ++ .../perllib/ComponentAppearanceTemplate.pm | 133 + gameserver/utils/tools/perllib/ConfigFile.pm | 158 + gameserver/utils/tools/perllib/Crc.pm | 86 + .../perllib/CustomizableShaderTemplate.pm | 183 ++ .../utils/tools/perllib/Customization.pm | 625 ++++ .../perllib/CustomizationVariableCollector.pm | 247 ++ .../tools/perllib/DetailAppearanceTemplate.pm | 137 + gameserver/utils/tools/perllib/Iff.pm | 892 ++++++ .../perllib/LightsaberAppearanceTemplate.pm | 152 + .../tools/perllib/LodMeshGeneratorTemplate.pm | 136 + .../tools/perllib/MeshAppearanceTemplate.pm | 133 + gameserver/utils/tools/perllib/PaletteArgb.pm | 61 + gameserver/utils/tools/perllib/Perforce.pm | 62 + .../tools/perllib/PortalAppearanceTemplate.pm | 150 + .../perllib/SkeletalAppearanceTemplate.pm | 136 + .../perllib/SkeletalMeshGeneratorTemplate.pm | 247 ++ .../tools/perllib/SwitchShaderTemplate.pm | 131 + gameserver/utils/tools/perllib/TreeFile.pm | 432 +++ .../VehicleCustomizationVariableGenerator.pm | 291 ++ gameserver/utils/tools/planetServerClean.pl | 45 + .../tools/printCustomizationVariables.pl | 180 ++ gameserver/utils/tools/publishBuildClean.pl | 52 + gameserver/utils/tools/recompileAllScripts.pl | 355 +++ .../tools/removeCustomizationDeclarations.pl | 226 ++ gameserver/utils/tools/reorgSourceMirror.pl | 35 + .../utils/tools/reportJavaExceptions.pl | 167 ++ .../utils/tools/reports/analyzeProfile.pl | 38 + .../reports/formatFilteredExceptionReport.pl | 68 + .../reports/formatFilteredWarningReport.pl | 75 + .../tools/reports/generateProfileReport.pl | 76 + .../tools/reports/reportJavaExceptions.pl | 167 ++ .../utils/tools/reports/reportLogChannels.pl | 28 + gameserver/utils/tools/resolve_live_check.pl | 10 + gameserver/utils/tools/scan-distcc.pl | 93 + gameserver/utils/tools/searchAndReplace.pl | 33 + gameserver/utils/tools/splitTreeFileRsp.pl | 73 + .../tools/stage_label_automatic_update.pl | 162 ++ gameserver/utils/tools/stage_label_check.pl | 156 + .../utils/tools/stage_label_manual_push.pl | 248 ++ gameserver/utils/tools/startServer.pl | 83 + gameserver/utils/tools/stopServer.pl | 14 + gameserver/utils/tools/stripChangeType.pl | 11 + gameserver/utils/tools/sumFileSize.pl | 15 + gameserver/utils/tools/swg-lint-win32.pl | 57 + gameserver/utils/tools/swglint.sh | 41 + gameserver/utils/tools/test_build_linux.pl | 494 ++++ gameserver/utils/tools/test_build_win32.pl | 215 ++ .../tools/translateExceptionDirectories.pl | 58 + gameserver/utils/tools/trickle_data_patch.pl | 60 + gameserver/utils/tools/unstutter.pl | 7 + .../utils/tools/updateCustomizationData.pl | 213 ++ .../tools/updateResourceVersionNumber.pl | 61 + gameserver/utils/tools/xargs.pl | 36 + src | 2 +- utils/.gitignore | 1 + utils/build_docker_images.sh | 5 +- utils/get_redist.sh | 20 +- utils/initial_setup.sh | 1 - 174 files changed, 29834 insertions(+), 41 deletions(-) create mode 100644 .dockerignore create mode 100644 gameserver/Dockerfile delete mode 100755 gameserver/utils/build_node_list.sh rename gameserver/utils/{ => content}/build_java.sh (100%) rename gameserver/utils/{ => content}/build_java_multi.sh (100%) rename gameserver/utils/{ => content}/build_java_single.sh (100%) rename gameserver/utils/{ => content}/build_miff.sh (89%) rename gameserver/utils/{ => content}/build_object_template_crc_string_tables.py (94%) rename gameserver/utils/{ => content}/build_quest_crc_string_tables.py (92%) rename gameserver/utils/{ => content}/build_tab.sh (82%) rename gameserver/utils/{ => content}/build_tab_multi.sh (100%) rename gameserver/utils/{ => content}/build_tdf.sh (100%) rename gameserver/utils/{ => content}/build_tpf.sh (100%) rename gameserver/utils/{ => content}/build_tpf_multi.sh (92%) create mode 100755 gameserver/utils/entrypoint.sh create mode 100755 gameserver/utils/tools/AutomatedDailyBuild.pl create mode 100755 gameserver/utils/tools/AutomatedDailyServerBuild.pl create mode 100755 gameserver/utils/tools/BuildChanges.pl create mode 100755 gameserver/utils/tools/BuildDsp.pl create mode 100644 gameserver/utils/tools/BuildFunctions.pm create mode 100755 gameserver/utils/tools/BuildLivePatchTreeFromChangelists.pl create mode 100755 gameserver/utils/tools/BuildVcproj.pl create mode 100755 gameserver/utils/tools/CheckPatchTreeSize.pl create mode 100755 gameserver/utils/tools/ContentSync.pl create mode 100755 gameserver/utils/tools/MoneyCheckActivity.pl create mode 100755 gameserver/utils/tools/MoneyNamedAccountToFrom.pl create mode 100755 gameserver/utils/tools/NormalizeExcelXml.pl create mode 100755 gameserver/utils/tools/ScanScript.pl create mode 100755 gameserver/utils/tools/SwgClientClean.pl create mode 100755 gameserver/utils/tools/SwgGameServerClean.pl create mode 100755 gameserver/utils/tools/SwgGodClientClean.pl create mode 100755 gameserver/utils/tools/allClientBuildClean.pl create mode 100755 gameserver/utils/tools/assignVertexShaderConstants.pl create mode 100644 gameserver/utils/tools/autotest/autotest.pl create mode 100644 gameserver/utils/tools/autotest/background_process.pl create mode 100644 gameserver/utils/tools/autotest/centralserver.pl create mode 100644 gameserver/utils/tools/autotest/databaseserver.pl create mode 100644 gameserver/utils/tools/autotest/loginserver.pl create mode 100644 gameserver/utils/tools/autotest/passfail.pl create mode 100644 gameserver/utils/tools/autotest/planetserver.pl create mode 100644 gameserver/utils/tools/autotest/serverconsole.pl create mode 100644 gameserver/utils/tools/autotest/taskmanager.pl create mode 100755 gameserver/utils/tools/buildAllVcproj.pl create mode 100755 gameserver/utils/tools/buildAppearanceTable.pl create mode 100755 gameserver/utils/tools/buildAppearanceUsage.pl create mode 100755 gameserver/utils/tools/buildAssetCustomizationManagerData.pl create mode 100644 gameserver/utils/tools/buildBranchBinaryLibs.sh create mode 100755 gameserver/utils/tools/buildCrcStringTable.pl create mode 100755 gameserver/utils/tools/buildObjectTemplateCrcStringTables.pl create mode 100755 gameserver/utils/tools/buildQuestCrcStringTables.pl create mode 100755 gameserver/utils/tools/buildTreeFileLookupTable.pl create mode 100755 gameserver/utils/tools/build_bootleg_linux.pl create mode 100755 gameserver/utils/tools/build_bootleg_win32.pl create mode 100755 gameserver/utils/tools/build_cluster_controller.pl create mode 100755 gameserver/utils/tools/build_cluster_daemon.pl create mode 100755 gameserver/utils/tools/checkChunkLoading.pl create mode 100755 gameserver/utils/tools/checkCreatureStrings.pl create mode 100755 gameserver/utils/tools/checkWritableSrc.pl create mode 100755 gameserver/utils/tools/check_environment.pl create mode 100755 gameserver/utils/tools/collectAssetCustomizationInfo.pl create mode 100755 gameserver/utils/tools/configFileBuilder.pl create mode 100644 gameserver/utils/tools/coreMemoryReport.sh create mode 100755 gameserver/utils/tools/coremail.pl create mode 100755 gameserver/utils/tools/crashCompare.pl create mode 100755 gameserver/utils/tools/crashSummarizeLocations.pl create mode 100755 gameserver/utils/tools/createClientOTs.pl create mode 100755 gameserver/utils/tools/createServerOTs.pl create mode 100755 gameserver/utils/tools/custTool.pl create mode 100755 gameserver/utils/tools/custUpgrade.pl create mode 100755 gameserver/utils/tools/custView.pl create mode 100755 gameserver/utils/tools/customBuildSteps.pl create mode 100755 gameserver/utils/tools/dataDirectoryDigestBuilder.pl create mode 100755 gameserver/utils/tools/dataLintParser.pl create mode 100755 gameserver/utils/tools/dependcat.pl create mode 100755 gameserver/utils/tools/emailDataLint.pl create mode 100755 gameserver/utils/tools/emailServerDataLint.pl create mode 100755 gameserver/utils/tools/estimatePatchSize.pl create mode 100755 gameserver/utils/tools/figureOfMeritCombatSimulator.pl create mode 100755 gameserver/utils/tools/filterWarnings.pl create mode 100755 gameserver/utils/tools/findAllCollideableObjects.pl create mode 100755 gameserver/utils/tools/findAssetsUsingCustomization.pl create mode 100755 gameserver/utils/tools/findBadSkeletonBindings.pl create mode 100755 gameserver/utils/tools/find_extension_in_files.pl create mode 100755 gameserver/utils/tools/find_tag_in_files.pl create mode 100755 gameserver/utils/tools/find_unchecked.pl create mode 100755 gameserver/utils/tools/fixSourceControlIntegration.pl create mode 100755 gameserver/utils/tools/fixupClientBakedWearableData.pl create mode 100755 gameserver/utils/tools/formatFilteredExceptionReport.pl create mode 100755 gameserver/utils/tools/gatherViewerWarnings.pl create mode 100755 gameserver/utils/tools/gatherWarnings.pl create mode 100755 gameserver/utils/tools/getFileSizeInDirectoryTree.pl create mode 100755 gameserver/utils/tools/headerLint.pl create mode 100755 gameserver/utils/tools/inctree.pl create mode 100755 gameserver/utils/tools/installTimer.pl create mode 100644 gameserver/utils/tools/lookupControllerMessage.sh create mode 100755 gameserver/utils/tools/makeAsynchronousLoadData.pl create mode 100755 gameserver/utils/tools/makeMultiplyReport.pl create mode 100755 gameserver/utils/tools/mapFileLookUpWin32.pl create mode 100755 gameserver/utils/tools/memoryReport.pl create mode 100755 gameserver/utils/tools/moveUpOrAddAttribute.pl create mode 100755 gameserver/utils/tools/newline.pl create mode 100755 gameserver/utils/tools/objectTemplateCreateCommands.pl create mode 100755 gameserver/utils/tools/p4FindUnchanged.pl create mode 100755 gameserver/utils/tools/p4_description_change_controller.pl create mode 100755 gameserver/utils/tools/p4_external_review.pl create mode 100755 gameserver/utils/tools/p4_integrate_deleted.pl create mode 100755 gameserver/utils/tools/p4consistency.pl create mode 100644 gameserver/utils/tools/p4dos2unix create mode 100755 gameserver/utils/tools/p4group.pl create mode 100755 gameserver/utils/tools/p4tar.pl create mode 100755 gameserver/utils/tools/p4unsync.pl create mode 100755 gameserver/utils/tools/p4untar.pl create mode 100755 gameserver/utils/tools/patchTreeRspBuilder.pl create mode 100644 gameserver/utils/tools/perllib/AppearanceTemplate.pm create mode 100644 gameserver/utils/tools/perllib/BlueprintTextureRendererTemplate.pm create mode 100644 gameserver/utils/tools/perllib/ComponentAppearanceTemplate.pm create mode 100644 gameserver/utils/tools/perllib/ConfigFile.pm create mode 100644 gameserver/utils/tools/perllib/Crc.pm create mode 100644 gameserver/utils/tools/perllib/CustomizableShaderTemplate.pm create mode 100644 gameserver/utils/tools/perllib/Customization.pm create mode 100644 gameserver/utils/tools/perllib/CustomizationVariableCollector.pm create mode 100644 gameserver/utils/tools/perllib/DetailAppearanceTemplate.pm create mode 100644 gameserver/utils/tools/perllib/Iff.pm create mode 100644 gameserver/utils/tools/perllib/LightsaberAppearanceTemplate.pm create mode 100644 gameserver/utils/tools/perllib/LodMeshGeneratorTemplate.pm create mode 100644 gameserver/utils/tools/perllib/MeshAppearanceTemplate.pm create mode 100644 gameserver/utils/tools/perllib/PaletteArgb.pm create mode 100644 gameserver/utils/tools/perllib/Perforce.pm create mode 100644 gameserver/utils/tools/perllib/PortalAppearanceTemplate.pm create mode 100644 gameserver/utils/tools/perllib/SkeletalAppearanceTemplate.pm create mode 100644 gameserver/utils/tools/perllib/SkeletalMeshGeneratorTemplate.pm create mode 100644 gameserver/utils/tools/perllib/SwitchShaderTemplate.pm create mode 100644 gameserver/utils/tools/perllib/TreeFile.pm create mode 100644 gameserver/utils/tools/perllib/VehicleCustomizationVariableGenerator.pm create mode 100755 gameserver/utils/tools/planetServerClean.pl create mode 100755 gameserver/utils/tools/printCustomizationVariables.pl create mode 100755 gameserver/utils/tools/publishBuildClean.pl create mode 100755 gameserver/utils/tools/recompileAllScripts.pl create mode 100755 gameserver/utils/tools/removeCustomizationDeclarations.pl create mode 100755 gameserver/utils/tools/reorgSourceMirror.pl create mode 100755 gameserver/utils/tools/reportJavaExceptions.pl create mode 100644 gameserver/utils/tools/reports/analyzeProfile.pl create mode 100644 gameserver/utils/tools/reports/formatFilteredExceptionReport.pl create mode 100644 gameserver/utils/tools/reports/formatFilteredWarningReport.pl create mode 100644 gameserver/utils/tools/reports/generateProfileReport.pl create mode 100644 gameserver/utils/tools/reports/reportJavaExceptions.pl create mode 100644 gameserver/utils/tools/reports/reportLogChannels.pl create mode 100755 gameserver/utils/tools/resolve_live_check.pl create mode 100755 gameserver/utils/tools/scan-distcc.pl create mode 100755 gameserver/utils/tools/searchAndReplace.pl create mode 100755 gameserver/utils/tools/splitTreeFileRsp.pl create mode 100755 gameserver/utils/tools/stage_label_automatic_update.pl create mode 100755 gameserver/utils/tools/stage_label_check.pl create mode 100755 gameserver/utils/tools/stage_label_manual_push.pl create mode 100755 gameserver/utils/tools/startServer.pl create mode 100755 gameserver/utils/tools/stopServer.pl create mode 100755 gameserver/utils/tools/stripChangeType.pl create mode 100755 gameserver/utils/tools/sumFileSize.pl create mode 100755 gameserver/utils/tools/swg-lint-win32.pl create mode 100644 gameserver/utils/tools/swglint.sh create mode 100755 gameserver/utils/tools/test_build_linux.pl create mode 100755 gameserver/utils/tools/test_build_win32.pl create mode 100755 gameserver/utils/tools/translateExceptionDirectories.pl create mode 100755 gameserver/utils/tools/trickle_data_patch.pl create mode 100755 gameserver/utils/tools/unstutter.pl create mode 100755 gameserver/utils/tools/updateCustomizationData.pl create mode 100755 gameserver/utils/tools/updateResourceVersionNumber.pl create mode 100755 gameserver/utils/tools/xargs.pl create mode 100644 utils/.gitignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..584ea29 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +dsrc/* +gameserver/* +src/* +.git/* +!src/external/3rd/library/curl/ diff --git a/build_dsrc.sh b/build_dsrc.sh index 9a7479a..6714c57 100755 --- a/build_dsrc.sh +++ b/build_dsrc.sh @@ -4,3 +4,9 @@ basedir=$PWD # ensure that repo has been setup $basedir/utils/initial_setup.sh +# run the docker image and build the source +docker run -v $basedir/gameserver/:/swg/:z -v $basedir/dsrc/:/swg/dsrc/:z -e SWG_BUILD_DSRC=TRUE swg-runtime + +# cleanup any artifacts +rm -rf $basedir/gameserver/dsrc/* +rm $basedir/gameserver/core diff --git a/gameserver/Dockerfile b/gameserver/Dockerfile new file mode 100644 index 0000000..658765f --- /dev/null +++ b/gameserver/Dockerfile @@ -0,0 +1,37 @@ +FROM debian:jessie +MAINTAINER seefo + +# install build dependencies +run apt-get update +run dpkg --add-architecture i386 && \ + apt-get update && \ + apt-get install -y alien rpm libc6:i386 libncurses5:i386 libstdc++6:i386 alien gcc-multilib g++-multilib binutils-multiarch libaio1:i386 libcurl4-gnutls-dev:i386 libpcre3:i386 libxml2:i386 libaio1 unixodbc + +# add redists +add ./utils/redist/ /redist/ + +# install redists +run fakeroot alien --target=amd64 -i /redist/oracle-instantclient12.1-basic-12.1.0.2.0-1.i386.rpm +run fakeroot alien --target=amd64 -i /redist/oracle-instantclient12.1-devel-12.1.0.2.0-1.i386.rpm +run fakeroot alien --target=amd64 -i /redist/oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.i386.rpm + +# install java +run cd /redist/ && \ + tar -xvzf IBMJava2-SDK-1.4.2-13.18.tgz && \ + mv IBMJava2-142/ /opt && \ + ln -s /opt/IBMJava2-142 /usr/java + +# build and install curl +add src/external/3rd/library/curl/curl-7.45.0 /redist/curl/ +run cd /redist/curl && ./configure && make && make install + +# env variables +ENV JAVA_HOME /usr/java +ENV ORACLE_HOME /usr/lib/oracle/12.1/client +run export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/12.1/client/lib:/usr/include/oracle/12.1/client +run ldconfig + +run apt-get install -y bc python-ply + +# entrypoint +ENTRYPOINT cd /swg/ && ./utils/entrypoint.sh diff --git a/gameserver/utils/build_node_list.sh b/gameserver/utils/build_node_list.sh deleted file mode 100755 index 9a1184c..0000000 --- a/gameserver/utils/build_node_list.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -NODE_COUNT= - -echo 'Generating node list...' - - -if [ ! -d ./exe/ ]; then - mkdir ./exe/ - mkdir ./exe/linux -fi - -read -p "How many nodes are in this cluster? " NODE_COUNT - -echo "[TaskManager]" > ./exe/linux/nodes.cfg - -# For each node, prompt for an ip. -for i in $(seq 0 $(expr $NODE_COUNT - 1)) -do - read -p "node$i ip: (Try using what is specified for your hostname in /etc/hosts " CURRENT_NODE_IP - echo "node$i=$CURRENT_NODE_IP" >> ./exe/linux/nodes.cfg -done - diff --git a/gameserver/utils/build_java.sh b/gameserver/utils/content/build_java.sh similarity index 100% rename from gameserver/utils/build_java.sh rename to gameserver/utils/content/build_java.sh diff --git a/gameserver/utils/build_java_multi.sh b/gameserver/utils/content/build_java_multi.sh similarity index 100% rename from gameserver/utils/build_java_multi.sh rename to gameserver/utils/content/build_java_multi.sh diff --git a/gameserver/utils/build_java_single.sh b/gameserver/utils/content/build_java_single.sh similarity index 100% rename from gameserver/utils/build_java_single.sh rename to gameserver/utils/content/build_java_single.sh diff --git a/gameserver/utils/build_miff.sh b/gameserver/utils/content/build_miff.sh similarity index 89% rename from gameserver/utils/build_miff.sh rename to gameserver/utils/content/build_miff.sh index 1f7a77b..1c0f196 100755 --- a/gameserver/utils/build_miff.sh +++ b/gameserver/utils/content/build_miff.sh @@ -12,7 +12,7 @@ for filename in $filenames; do mkdir -p $(dirname $ofilename) if [[ -e $ofilename && $filename -nt $ofilename ]] || [ ! -e $ofilename ]; then - result=$(./exe/linux/bin/Miff -i "$filename" -o "$ofilename" 2>&1) + result=$(./bin/Miff -i "$filename" -o "$ofilename" 2>&1) if [[ ! "$result" =~ .*successfully.* ]]; then printf "\r$result\n\n" diff --git a/gameserver/utils/build_object_template_crc_string_tables.py b/gameserver/utils/content/build_object_template_crc_string_tables.py similarity index 94% rename from gameserver/utils/build_object_template_crc_string_tables.py rename to gameserver/utils/content/build_object_template_crc_string_tables.py index 9b99ac3..f02c2d3 100755 --- a/gameserver/utils/build_object_template_crc_string_tables.py +++ b/gameserver/utils/content/build_object_template_crc_string_tables.py @@ -29,7 +29,7 @@ def build_table(type, objs): if not path.exists(path.dirname(ifffile)): makedirs(path.dirname(ifffile)) - crc_call = ['./tools/buildCrcStringTable.pl', '-t', tabfile, ifffile] + crc_call = ['./utils/tools/buildCrcStringTable.pl', '-t', tabfile, ifffile] p = Popen(crc_call, stdin=PIPE, stdout=PIPE) diff --git a/gameserver/utils/build_quest_crc_string_tables.py b/gameserver/utils/content/build_quest_crc_string_tables.py similarity index 92% rename from gameserver/utils/build_quest_crc_string_tables.py rename to gameserver/utils/content/build_quest_crc_string_tables.py index 2ebf484..abf902c 100755 --- a/gameserver/utils/build_quest_crc_string_tables.py +++ b/gameserver/utils/content/build_quest_crc_string_tables.py @@ -34,7 +34,7 @@ if not path.exists(path.dirname(tabfile)): if not path.exists(path.dirname(ifffile)): makedirs(path.dirname(ifffile)) -crc_call = ['./tools/buildCrcStringTable.pl', '-t', tabfile, ifffile] +crc_call = ['./utils/tools/buildCrcStringTable.pl', '-t', tabfile, ifffile] p = Popen(crc_call, stdin=PIPE, stdout=PIPE) diff --git a/gameserver/utils/build_tab.sh b/gameserver/utils/content/build_tab.sh similarity index 82% rename from gameserver/utils/build_tab.sh rename to gameserver/utils/content/build_tab.sh index 23066c2..97f5e5b 100755 --- a/gameserver/utils/build_tab.sh +++ b/gameserver/utils/content/build_tab.sh @@ -17,7 +17,7 @@ for filename in ${filenames[@]}; do mkdir -p $(dirname $ofilename) if [[ -e $ofilename && $filename -nt $ofilename ]] || [ ! -e $ofilename ]; then - result=$(./exe/linux/bin/DataTableTool -i "$filename" -o "$ofilename" -- -s SharedFile searchPath10=data/sku.0/sys.shared/compiled/game searchPath10=data/sku.0/sys.server/compiled/game 2>&1) + result=$(./bin/DataTableTool -i "$filename" -o "$ofilename" -- -s SharedFile searchPath10=data/sku.0/sys.shared/compiled/game searchPath10=data/sku.0/sys.server/compiled/game 2>&1) if [[ ! $result =~ .*SUCCESS.* ]]; then printf "\r$filename\n" diff --git a/gameserver/utils/build_tab_multi.sh b/gameserver/utils/content/build_tab_multi.sh similarity index 100% rename from gameserver/utils/build_tab_multi.sh rename to gameserver/utils/content/build_tab_multi.sh diff --git a/gameserver/utils/build_tdf.sh b/gameserver/utils/content/build_tdf.sh similarity index 100% rename from gameserver/utils/build_tdf.sh rename to gameserver/utils/content/build_tdf.sh diff --git a/gameserver/utils/build_tpf.sh b/gameserver/utils/content/build_tpf.sh similarity index 100% rename from gameserver/utils/build_tpf.sh rename to gameserver/utils/content/build_tpf.sh diff --git a/gameserver/utils/build_tpf_multi.sh b/gameserver/utils/content/build_tpf_multi.sh similarity index 92% rename from gameserver/utils/build_tpf_multi.sh rename to gameserver/utils/content/build_tpf_multi.sh index ec3d47a..e015f1d 100755 --- a/gameserver/utils/build_tpf_multi.sh +++ b/gameserver/utils/content/build_tpf_multi.sh @@ -12,7 +12,7 @@ compile () { mkdir -p $(dirname $ofilename) if [[ -e $ofilename && $filename -nt $ofilename ]] || [ ! -e $ofilename ]; then - result=$(./exe/linux/bin/TemplateCompiler -compile "$filename" 2>&1) + result=$(./bin/TemplateCompiler -compile "$filename" 2>&1) if [[ ! -z $result ]]; then printf "\r$filename\n" diff --git a/gameserver/utils/entrypoint.sh b/gameserver/utils/entrypoint.sh new file mode 100755 index 0000000..4e259ee --- /dev/null +++ b/gameserver/utils/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/bash +basedir=$PWD + +if [[ -z "${SWG_BUILD_DSRC}" ]]; then + echo "Running Server" +else + echo "Building DSRC" + $basedir/utils/content/build_miff.sh + $basedir/utils/content/build_tab.sh + $basedir/utils/content/build_tpf_multi.sh + + $basedir/utils/content/build_object_template_crc_string_tables.py + $basedir/utils/content/build_quest_crc_string_tables.py + echo "Done building DSRC" +fi diff --git a/gameserver/utils/tools/AutomatedDailyBuild.pl b/gameserver/utils/tools/AutomatedDailyBuild.pl new file mode 100755 index 0000000..29463df --- /dev/null +++ b/gameserver/utils/tools/AutomatedDailyBuild.pl @@ -0,0 +1,146 @@ +#!/usr/bin/perl -w +use File::Find; +use BuildFunctions; + + +### + # Copyright (C)2000-2002 Sony Online Entertainment Inc. + # All Rights Reserved + # + # Title: AutomatedDailyBuild.pl + # Description: Forces a sync to current, syncs to head, builds all_Client, SWGGameServer, PlanetServer, and SwgLoadServer and check for writable files in the src directory then emails log files to gmcdaniel. + # @author $Author: gmcdaniel $ + # @version $Revision: #17 $ + ## + + +## +# This subroutine finds any non-authorized writable files in a passed directory + +sub Find_Writable +{ + if (-d $_) + { + # found a directory entry + + # prune the directory if it's one we want to ignore + if (m/^(compile)$/) + { + #prune it + $File::Find::prune = 1; + } + } + elsif (-f and -w $_) + { if (!m/^.*(aps|ncb|opt|plg)$/) + { + print "n $File::Find::name\n"; + print Logfile "n $File::Find::name\n"; + } + } +} # End of sub Find_Writable + + + +########## MAIN ########## + + + +## +# Delete compile directory for clean build + + system("c:\\4nt302\\4nt /c del /s /y ..\\src\\compile"); + +# +## End of Delete compile directory for clean build + + + +## +# Sync Code to Head + + print ("Beginning Sync to Head...\n"); + # sync client that points to d:\workdaily + system ("p4 -c gmcdaniel-wxp-gmcdaniel-build-station-machine_daily_build sync //depot/swg...\#head"); + print ("Sync Complete\n"); + print ("\n"); + print ("\n"); + +# +## End of Sync Code to Head + + + +## +# Forced Code + + print ("Beginning Forced Sync...\n"); + # sync client that points to d:\workdaily + system ("p4 -c gmcdaniel-wxp-gmcdaniel-build-station-machine_daily_build sync -f //depot/swg...\#have"); + print ("Sync Complete\n"); + print ("\n"); + print ("\n"); + +# +## End of Forced Sync + + + + +## +# Build Projects and Check for Errors + + build_project ("_all_client"); + Check_For_Warnings_and_Errors("_all_client"); + + #build_project ("PlanetServer"); + #Check_For_Warnings_and_Errors("PlanetServer"); + + #build_project ("SwgGameServer"); + #Check_For_Warnings_and_Errors("SwgGameServer"); + + #build_project ("SwgLoadClient"); + #Check_For_Warnings_and_Errors("SwgLoadClient"); + +# +## End of Build Projects and Check for Errors + + + + + +## +# Check for any non-authorized writable files in the /swg/current/src directory and email the results + + + + ### Email addresses + #$gmcdaniel = "gmcdaniel\@soe.sony.com"; + + + #$writable_files_log = "WritableFiles.log"; + + #print ("Checking for writable files...\n"); + #open (Logfile, ">d:\\buildlogs\\$writable_files_log") || die "Sorry, I couldn't create $writable_files_log"; + #print Logfile "The writable files that were found:\n"; + + # do a find + #$search_path = "..\\src"; + #@ARGV = ($search_path); + #find(\&Find_Writable, @ARGV); + + #close (Logfile); + + #$writable_test_time_and_date = get_time_and_date(); + #$date_stamp = get_date(); + #system ("copy d:\\buildlogs\\$writable_files_log d:\\buildlogs\\WritableFiles_$writable_test_time_and_date.log"); + #print ("Checking for writable files completed\n"); + #print ("\n"); + #print ("\n"); + #system ("postie -host:sdt-mx1.station.sony.com -to:$gmcdaniel -from:$gmcdaniel -s:\"Writable Files Results $date_stamp\" -nomsg -file:d:\\buildlogs\\WritableFiles_$writable_test_time_and_date.log"); + +# +## End of Check for any non-authorized writable files in the /swg/current/src directory and email the results + + + +########## END OF MAIN ########## diff --git a/gameserver/utils/tools/AutomatedDailyServerBuild.pl b/gameserver/utils/tools/AutomatedDailyServerBuild.pl new file mode 100755 index 0000000..433480f --- /dev/null +++ b/gameserver/utils/tools/AutomatedDailyServerBuild.pl @@ -0,0 +1,45 @@ +#!/usr/bin/perl -w + + + +########## MAIN ########## + + + +## +# + + + print ("Synching to head\n"); + system ("p4 sync \#head"); + print ("End of sync to head\n"); + + print ("Cleaning process...\n"); + system ("make -C ./work/swg/current/src/build/linux/ cleanall"); + print ("Cleaning Process Complete\n"); + + + print ("Starting Debug Server Build\n"); + system ("make -C ./work/swg/current/src/build/linux/ debug 2>&1 | tee grant debug.log"); + print ("Debug Server Build Complete\n"); + print ("\n"); + + print ("Cleaning process...\n"); + system ("make -C ./work/swg/current/src/build/linux/ cleanall"); + print ("Cleaning Process Complete\n"); + + + print ("Starting Release Server Build\n"); + system ("make -C ./work/swg/current/src/build/linux/ release 2>&1 | tee grantrelease.log"); + print ("Release Server Build Complete\n"); + print ("Mailing debug log"); + system ("mail -s \"[BUILDLOG] Daily Debug Server Log\" gmcdaniel\@soe.sony.com cmayer\@soe.sony.com asommers\@soe.sony.com jgrills\@soe.sony.com jbrack\@soe.sony.com ; +close(P4); + +foreach (@changes) +{ + chomp; + s/'.*//; + my $changeline = $_; + s/^Change //; + s/ .*//; + my $change = $_; + + open(P4, "p4 describe -s $change |"); + my $public = ""; + my $internal = ""; + my $testplan = ""; + my $junk = ""; + my $section = "junk"; + while () + { + if (s/^\t//) + { + if (/\[public\]/) + { + $section = "public"; + } + elsif (/\[internal\]/) + { + $section = "internal"; + } + elsif (/\[testplan\]/) + { + $section = "testplan"; + } + elsif (/\[/) + { + $section = "junk"; + } + elsif ($_ ne "\n") + { + $public .= $_ if ($section eq "public"); + $internal .= $_ if ($section eq "internal"); + $testplan .= $_ if ($section eq "testplan"); + } + } + else + { + $section = "junk"; + } + } + close(P4); + + print $changeline,"\n" if ($public ne "" || ($showInternal && $internal ne "") || ($showTestplan && $testplan ne "")); + print "[public]\n", $public, "\n" if ($public ne ""); + print "[internal]\n", $internal, "\n" if ($showInternal && $internal ne ""); + print "[testplan]\n", $testplan, "\n" if ($showTestplan && $testplan ne ""); + print "\n\n" if ($public ne "" || $internal ne "" || $testplan ne ""); +} diff --git a/gameserver/utils/tools/BuildDsp.pl b/gameserver/utils/tools/BuildDsp.pl new file mode 100755 index 0000000..d76b9f3 --- /dev/null +++ b/gameserver/utils/tools/BuildDsp.pl @@ -0,0 +1,1603 @@ +#!/usr/bin/perl +# ===================================================================== + +# figure out what project file we're building +$project = $ARGV[0]; +die "no project name specified" if (!defined($project)); + +# lop off the directories +$project =~ s#^.*[/\\]##; + +# lop off the extension +$project =~ s#\.dsp$##; + +# capitalize the first letter of the string +$Project = $project; +substr($Project,0,1) =~ tr/a-z/A-Z/; + +# get the directory path, paths need to be relative to the project files +$directory = $ARGV[0]; +if ($directory =~ s#[/\\][^/\\]+$## != 0) +{ + chdir($directory) || die "could not change into directory ". $directory; +} + +# ===================================================================== + +# setup defaults +@defines_debug = ("WIN32", "_DEBUG", "_MBCS", "DEBUG_LEVEL=2"); +@defines_optimized = ("WIN32", "_DEBUG", "_MBCS", "DEBUG_LEVEL=1"); +@defines_release = ("WIN32", "NDEBUG", "_MBCS", "DEBUG_LEVEL=0"); + +$fixQt = 0; + +$optimizedOptimizations = " /Ox /Ot /Og /Oi /Oy-"; +$dbgInfo_d = makeDebugInfoFlag("pdb"); +$dbgInfo_o = makeDebugInfoFlag("pdb"); +$dbgInfo_r = makeDebugInfoFlag("pdb"); +$minimalRebuild = " /Gm"; + +# ===================================================================== +# process RSP files + +open(RSP, "settings.rsp") || die "could not open settings.rsp for " . $project . ", "; +while () +{ + # handle comments + s/#.*//; + + foreach (split) + { + if ($_ eq "windows") + { + $output = $template_windows; + push(@defines_debug, "_WINDOWS"); + push(@defines_optimized, "_WINDOWS"); + push(@defines_release, "_WINDOWS"); + } + elsif ($_ eq "mfc") + { + $output = $template_mfc; + push(@defines_debug, "_WINDOWS"); + push(@defines_optimized, "_WINDOWS"); + push(@defines_release, "_WINDOWS"); + } + elsif ($_ eq "qt334") + { + $output = $template_windows; + push(@defines_debug, "_WINDOWS", "QT_DLL", "QT_NO_STL", "QT_ACCESSIBILITY_SUPPORT"); + push(@defines_optimized, "_WINDOWS", "QT_DLL", "QT_NO_STL", "QT_ACCESSIBILITY_SUPPORT"); + push(@defines_release, "_WINDOWS", "QT_DLL", "QT_NO_STL", "QT_ACCESSIBILITY_SUPPORT"); + $qt_version = "3.3.4"; + $fixQt = 1; + } + elsif ($_ eq "qt410" || $_ eq "qt") + { + $output = $template_windows; + push(@defines_debug, "_WINDOWS", "QT_DLL", "QT_NO_STL", "QT_ACCESSIBILITY_SUPPORT", "QT3_SUPPORT"); + push(@defines_optimized, "_WINDOWS", "QT_DLL", "QT_NO_STL", "QT_ACCESSIBILITY_SUPPORT", "QT3_SUPPORT"); + push(@defines_release, "_WINDOWS", "QT_DLL", "QT_NO_STL", "QT_ACCESSIBILITY_SUPPORT", "QT3_SUPPORT"); + $qt_version = "4.1.0"; + $fixQt = 1; + } + elsif ($_ eq "console") + { + $output = $template_console; + push(@defines_debug, "_CONSOLE"); + push(@defines_optimized, "_CONSOLE"); + push(@defines_release, "_CONSOLE"); + } + elsif ($_ eq "library") + { + $output = $template_library; + + push(@defines_debug, "_LIB"); + push(@defines_optimized, "_LIB"); + push(@defines_release, "_LIB"); + } + elsif ($_ eq "utility") + { + $output = $template_utility; + } + elsif ($_ eq "noPchDirectory") + { + $noPchDir = 1; + } + elsif ($_ eq "stdafx") + { + $stdafx = 1; + } + elsif ($_ eq "p4") + { + push(@defines_debug, "CASE_INSENSITIVE", "OS_NT"); + push(@defines_optimized, "CASE_INSENSITIVE", "OS_NT"); + push(@defines_release, "CASE_INSENSITIVE", "OS_NT"); + } + elsif ($_ eq "unicode") + { + push(@defines_debug, "_UNICODE", "UNICODE"); + push(@defines_optimized, "_UNICODE", "UNICODE"); + push(@defines_release, "_UNICODE", "UNICODE"); + } + elsif (s/^Zm//) + { + $zm = " /Zm" . $_ . " "; + } + elsif (s/^dbgInfo_d_//) + { + $dbgInfo_d = makeDebugInfoFlag($_); + } + elsif (s/^dbgInfo_o_//) + { + $dbgInfo_o = makeDebugInfoFlag($_); + } + elsif (s/^dbgInfo_r_//) + { + $dbgInfo_r = makeDebugInfoFlag($_); + } + elsif (s/^incremental_d_//) + { + $incremental_d = " /incremental:" . $_; + } + elsif (s/^incremental_o_//) + { + $incremental_o = " /incremental:" . $_; + } + elsif (s/^incremental_r_//) + { + $incremental_r = " /incremental:" . $_; + } + elsif (/Gm-/) + { + $minimalRebuild = " /Gm-"; + + } + elsif ($_ eq "copyDev") + { + $copyDev = 1; + } + elsif ($_ eq "debugInline") + { + $debugInline = " /Ob1"; + } + elsif ($_ eq "disableOptimizationsInOpt") + { + $optimizedOptimizations = " /Od /Oy-"; + } + else + { + die "unknown option ", $_, "\n"; + } + } +} +close(RSP); + +# read in the includes list +push(@defines_debug, process_rsp("defines_d.rsp", "defines.rsp")); +push(@defines_optimized, process_rsp("defines_o.rsp", "defines.rsp")); +push(@defines_release, process_rsp("defines_r.rsp", "defines.rsp")); + +# read in the includes list +@includeDirectories_debug = process_rsp("includePaths_d.rsp", "includePaths.rsp"); +@includeDirectories_optimized = process_rsp("includePaths_o.rsp", "includePaths.rsp"); +@includeDirectories_release = process_rsp("includePaths_r.rsp", "includePaths.rsp"); + +# get in the libraries +@libraries_debug = process_rsp("libraries_d.rsp", "libraries.rsp"); +@libraries_optimized = process_rsp("libraries_o.rsp", "libraries.rsp"); +@libraries_release = process_rsp("libraries_r.rsp", "libraries.rsp"); + +# get the libraries to ignore +@ignoreLibraries_debug = process_rsp("ignoreLibraries_d.rsp", "ignoreLibraries.rsp"); +@ignoreLibraries_optimized = process_rsp("ignoreLibraries_o.rsp", "ignoreLibraries.rsp"); +@ignoreLibraries_release = process_rsp("ignoreLibraries_r.rsp", "ignoreLibraries.rsp"); + +# get the libraries search directory paths +@libraryDirectories_debug = process_rsp("libraryPaths_d.rsp", "libraryPaths.rsp"); +@libraryDirectories_optimized = process_rsp("libraryPaths_o.rsp", "libraryPaths.rsp"); +@libraryDirectories_release = process_rsp("libraryPaths_r.rsp", "libraryPaths.rsp"); + + +if ($fixQt) +{ + fixup_qt_path(@includeDirectories_debug); + fixup_qt_path(@includeDirectories_optimized); + fixup_qt_path(@includeDirectories_release); + fixup_qt_path(@libraryDirectories_debug); + fixup_qt_path(@libraryDirectories_optimized); + fixup_qt_path(@libraryDirectories_release); + + fixup_qt_lib(@libraries_debug); + fixup_qt_lib(@libraries_optimized); + fixup_qt_lib(@libraries_release); +} + + +# ===================================================================== +# scan the current vcproj looking for per-file settings to preserve + +if (open(DSP, $project . ".dsp")) +{ + while () + { + s/\r//; + + # look for per-file settings to preserve + if ($state == 1) + { + if ($_ eq "# End Source File\n") + { + $state = 0; + } + else + { + $settings{$filename} .= $_; + } + } + if ($state == 0 && s/^SOURCE=//) + { + chomp; + s/^"//; + s/"$//; + $filename = $_; + $state = 1; + } + } + close(DSP); +} + +# override the custom build steps for headers that need moc'ed +open(RSP, "mocHeaders.rsp"); +while () +{ + chomp; + + # handle comments + s/#.*//; + + # clean up the input + s/^\s+//; + s/\s+$//; + s#/#\\#g; + + if ($_ ne "") + { + # get just the file name + $name = $_; + $name =~ s#^.*\\##; + $name =~ s#\..*$##; + + $settings{$_} = $mocHeader; + $settings{$_} =~ s/%%inputPath%%/$_/g; + $settings{$_} =~ s/%%inputName%%/$name/g; + } +} +close(RSP); + + +# ===================================================================== +# + +sub makeDebugInfoFlag +{ + my $input = $_[0]; + local $flag = ""; + local $_; + + if ( $input eq "line_numbers_only" ) + { + $flag = " /Zd"; + } + elsif ( $input eq "pdb" ) + { + $flag = " /Zi"; + } + elsif ( $input eq "edit_and_continue" ) + { + $flag = " /ZI"; + } + elsif ( $input eq "none" ) + { + $flag = ""; + } + else + { + die "Unknown setting for dbgInfo: $input\n"; + } + + return $flag; +} + +sub fixup_qt_path +{ + foreach (@_) + { + s/qt\\[0-9]\.[0-9]\.[0-9]/qt\\$qt_version/; + } +} + +sub fixup_qt_lib +{ + my $qtlibver = $qt_version; + $qtlibver =~ s/\.//g; + + foreach (@_) + { + s/qt-mt[0-9][0-9][0-9]/qt-mt$qtlibver/; + } +} + + +# ===================================================================== +# find all the non-linux source files + +sub addfile +{ + my $pathed = $_[0]; + local $_ = $pathed; + + # lop off the directories + s#.*/##; + s#.*\\##; + + if (/\.cpp$/) + { + $sourceNames{$_} = $pathed; + } + elsif (/\.h$/) + { + $headerNames{$_} = $pathed; + } + elsif (/\.def$/) + { + $headerNames{$_} = $pathed; + $settings{$pathed} = "# PROP Exclude_From_Build 1\n"; + } + elsif (/\.ui$/) + { + $uiNames{$_} = $pathed; + + $settings{$pathed} = $ui; + $settings{$pathed} =~ s/%%inputPath%%/$pathed/g; + $noExt = $_; + $noExt =~ s/\.ui$//; + $settings{$pathed} =~ s/%%inputName%%/$noExt/g; + } + elsif (/\.template$/) + { + $templateNames{$_} = $pathed; + } + elsif (/\.rc$/) + { + $resourceNames{$_} = $pathed; + } + elsif (/\.ico$/ || /\.cur$/ || /\.bmp$/) + { + $resourceNames{$_} = $pathed; + } +} + +sub dodir +{ + local $_; + my $dir = $_[0]; + + opendir(DIR, $dir) || return; + my @filenames = readdir(DIR); + closedir(DIR); + + for (@filenames) + { + next if $_ eq "."; + next if $_ eq ".."; + + $pathed = $dir . "\\" . $_; + + if (-d $pathed) + { + next if ($_ eq "linux"); + next if ($_ eq "solaris"); + &dodir($pathed); + } + else + { + &addfile($pathed); + } + } +} +&dodir("..\\..\\src"); +&dodir("..\\..\\src_oci"); +&dodir("..\\..\\src_odbc"); +&dodir("..\\..\\ui"); + +# get any additional files to include in the build +open(RSP, "additionalFiles.rsp"); +while () +{ + # handle comments + s/#.*//; + + chomp; + s/\s+$//; + &addfile($_) if ($_ ne ""); +} +close(RSP); + +# ===================================================================== +# process all the source files + +# Make sure all First*.cpp projects build the PCH + +$_ = $settings{$sourceNames{"First$Project.cpp"}}; + +if (! /.*\/Yc.*/ ) +{ + $settings{$sourceNames{"First$Project.cpp"}} = $_ . "\n# ADD CPP /Yc\n"; +} + +foreach (sort { lc($a) cmp lc($b) } keys %sourceNames) +{ + $_ = $sourceNames{$_}; + $sources .= "# Begin Source File\n\nSOURCE=$_\n$settings{$_}# End Source File\n"; +} + +foreach (sort { lc($a) cmp lc($b) } keys %headerNames) +{ + $_ = $headerNames{$_}; + $headers .= "# Begin Source File\n\nSOURCE=$_\n$settings{$_}# End Source File\n"; +} + +foreach (sort { lc($a) cmp lc($b) } keys %resourceNames) +{ + $_ = $resourceNames{$_}; + $resources .= "# Begin Source File\n\nSOURCE=$_\n$settings{$_}# End Source File\n"; +} + +foreach (sort { lc($a) cmp lc($b) } keys %templateNames) +{ + $_ = $templateNames{$_}; + $templates .= "# Begin Source File\n\nSOURCE=$_\n$settings{$_}# End Source File\n"; +} + +foreach (sort { lc($a) cmp lc($b) } keys %uiNames) +{ + $_ = $uiNames{$_}; + $uis .= "# Begin Source File\n\nSOURCE=$_\n$settings{$_}# End Source File\n"; + + s/^.*[\\\/]//; + s/\.ui$//; + + $uiGeneratedSources_debug .= "# Begin Source File\n\nSOURCE=..\\..\\..\\..\\..\\..\\compile\\win32\\%%project%%\\Debug\\${_}_d.cpp\n$debug_ui_cpp# End Source File\n"; + $uiGeneratedHeaders_debug .= "# Begin Source File\n\nSOURCE=..\\..\\..\\..\\..\\..\\compile\\win32\\%%project%%\\Debug\\$_.h\n# End Source File\n"; + $uiGeneratedSources_optimized .= "# Begin Source File\n\nSOURCE=..\\..\\..\\..\\..\\..\\compile\\win32\\%%project%%\\Optimized\\${_}_o.cpp\n$optimized_ui_cpp# End Source File\n"; + $uiGeneratedHeaders_optimized .= "# Begin Source File\n\nSOURCE=..\\..\\..\\..\\..\\..\\compile\\win32\\%%project%%\\Optimized\\$_.h\n# End Source File\n"; + $uiGeneratedSources_release .= "# Begin Source File\n\nSOURCE=..\\..\\..\\..\\..\\..\\compile\\win32\\%%project%%\\Release\\${_}_r.cpp\n$release_ui_cpp# End Source File\n"; + $uiGeneratedHeaders_release .= "# Begin Source File\n\nSOURCE=..\\..\\..\\..\\..\\..\\compile\\win32\\%%project%%\\Release\\$_.h\n# End Source File\n"; +} + +# ===================================================================== +# set up the replacements + +# setup the replacement strings +$replace{"%%project%%"} = $project; +$replace{"%%sources%%\n"} = $sources; +$replace{"%%headers%%\n"} = $headers; +$replace{"%%resources%%\n"} = $resources; +$replace{"%%templates%%\n"} = $templates; +$replace{" %%debugInline%%"} = $debugInline; +$replace{" %%dbgInfo_r%%"} = $dbgInfo_r; +$replace{" %%dbgInfo_o%%"} = $dbgInfo_o; +$replace{" %%dbgInfo_d%%"} = $dbgInfo_d; +$replace{" %%incremental_r%%"} = $incremental_r; +$replace{" %%incremental_o%%"} = $incremental_o; +$replace{" %%incremental_d%%"} = $incremental_d; +$replace{" %%minimalRebuild%%"} = $minimalRebuild; +$replace{" %%optimizedOptimizations%%"} = $optimizedOptimizations; +$replace{" %%zm%%"} = $zm; +$replace{" %%includeDirectories_debug%%"} = explode("/I \"", "\"", @includeDirectories_debug); +$replace{" %%includeDirectories_optimized%%"} = explode("/I \"", "\"", @includeDirectories_optimized); +$replace{" %%includeDirectories_release%%"} = explode("/I \"", "\"", @includeDirectories_release); +$replace{" %%defines_debug%%"} = explode("/D \"", "\"", @defines_debug); +$replace{" %%defines_optimized%%"} = explode("/D \"", "\"", @defines_optimized); +$replace{" %%defines_release%%"} = explode("/D \"", "\"", @defines_release); +$replace{" %%libraries_debug%%"} = explode("", "", @libraries_debug); +$replace{" %%libraries_optimized%%"} = explode("", "", @libraries_optimized); +$replace{" %%libraries_release%%"} = explode("", "", @libraries_release); +$replace{" %%libraryDirectories_debug%%"} = explode("/libpath:\"", , "\"", @libraryDirectories_debug); +$replace{" %%libraryDirectories_optimized%%"} = explode("/libpath:\"", , "\"", @libraryDirectories_optimized); +$replace{" %%libraryDirectories_release%%"} = explode("/libpath:\"", , "\"", @libraryDirectories_release); +$replace{" %%ignoreLibraries_debug%%"} = explode("/nodefaultlib:\"", , "\"", @ignoreLibraries_debug); +$replace{" %%ignoreLibraries_optimized%%"} = explode("/nodefaultlib:\"", , "\"", @ignoreLibraries_optimized); +$replace{" %%ignoreLibraries_release%%"} = explode("/nodefaultlib:\"", , "\"", @ignoreLibraries_release); + +$replace{"%%uis%%"} = $uis; +$replace{"%%uiGeneratedSources_debug%%"} = $uiGeneratedSources_debug; +$replace{"%%uiGeneratedHeaders_debug%%"} = $uiGeneratedHeaders_debug; +$replace{"%%uiGeneratedSources_optimized%%"} = $uiGeneratedSources_optimized; +$replace{"%%uiGeneratedHeaders_optimized%%"} = $uiGeneratedHeaders_optimized; +$replace{"%%uiGeneratedSources_release%%"} = $uiGeneratedSources_release; +$replace{"%%uiGeneratedHeaders_release%%"} = $uiGeneratedHeaders_release; + +$replace{"%%qt_version%%"} = $qt_version; + +if ($copyDev) +{ + $replace{"%%specialBuildTool_release%%\n"} = $specialBuildTool_release; + $replace{"%%specialBuildTool_optimized%%\n"} = $specialBuildTool_optimized; + $replace{"%%specialBuildTool_debug%%\n"} = $specialBuildTool_debug; +} +else +{ + $replace{"%%specialBuildTool_release%%\n"} = ""; + $replace{"%%specialBuildTool_optimized%%\n"} = ""; + $replace{"%%specialBuildTool_debug%%\n"} = ""; +} + +if ($copyDev) +{ + $replace{"%%postBuild_release%%\n"} = $postBuild_release; + $replace{"%%postBuild_optimized%%\n"} = $postBuild_optimized; + $replace{"%%postBuild_debug%%\n"} = $postBuild_debug; +} +else +{ + $replace{"%%postBuild_release%%\n"} = ""; + $replace{"%%postBuild_optimized%%\n"} = ""; + $replace{"%%postBuild_debug%%\n"} = ""; +} + +if ($copyDev) +{ + $replace{"%%preLink_release%%\n"} = ""; + $replace{"%%preLink_optimized%%\n"} = ""; + $replace{"%%preLink_debug%%\n"} = ""; +} +else +{ + $replace{"%%preLink_release%%\n"} = ""; + $replace{"%%preLink_optimized%%\n"} = ""; + $replace{"%%preLink_debug%%\n"} = ""; +} + +if ($copyDev) +{ + $replace{"%%copyDev_release%%"} = "copy \$(TargetPath) ..\\..\\..\\..\\..\\..\\..\\dev\\win32\\%%project%%_r.exe"; + $replace{"%%copyDev_optimized%%"} = "copy \$(TargetPath) ..\\..\\..\\..\\..\\..\\..\\dev\\win32\\%%project%%_o.exe"; + $replace{"%%copyDev_debug%%"} = "copy \$(TargetPath) ..\\..\\..\\..\\..\\..\\..\\dev\\win32\\%%project%%_d.exe"; +} +else +{ + $replace{"%%copyDev_release%%"} = ""; + $replace{"%%copyDev_optimized%%"} = ""; + $replace{"%%copyDev_debug%%"} = ""; +} + +if ($stdafx) +{ + $replace{"%%pch%%"} = "StdAfx.h"; +} +else +{ + if ($noPchDir) + { + $replace{"%%pch%%"} = "First" . $Project . ".h"; + } + else + { + $replace{"%%pch%%"} = $project . "\\First" . $Project . ".h"; + } +} + +# ===================================================================== + +# do all the replacements repeatedly until no more replacements can be made +do +{ + $changed = 0; + foreach $key (keys %replace) + { + $changed += $output =~ s/$key/$replace{$key}/; + } +} while ($changed > 0); + +# convert newlines to cr/lf sequences +$output =~ s/\n/\cM\cJ/g; + +# save the output +open(DSP, ">" . $project . ".dsp") || die "could not open project file " . $project . ".dsp for writing\n"; +binmode(DSP); +print DSP $output; +close(DSP); + +# ===================================================================== + +BEGIN +{ + +sub process_rsp +{ + local $_; + my @rsp; + while (@_) + { + open(RSP, shift @_); + while () + { + chomp; + + # handle comments + s/#.*//; + + s/\s+$//; + tr/\//\\/; + push(@rsp, $_) if ($_ ne ""); + } + close(RSP); + } + return @rsp; +} + +sub explode +{ + local $_; + my $result = ""; + my $prefix = shift @_; + my $suffix = shift @_; + + foreach (@_) + { + $result .= " " . $prefix . $_ . $suffix; + } + return $result; +} + +# --------------------------------------------------------------------- + +$template_library = +q@# Microsoft Developer Studio Project File - Name="%%project%%" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=%%project%% - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "%%project%%.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "%%project%%.mak" CFG="%%project%% - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "%%project%% - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "%%project%% - Win32 Optimized" (based on "Win32 (x86) Static Library") +!MESSAGE "%%project%% - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "%%project%%" +# PROP Scc_LocalPath "..\.." +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "%%project%% - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Release" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W4 /WX /GR /GX %%dbgInfo_r%% /O2 %%includeDirectories_release%% %%defines_release%% /Yu"%%pch%%" /FD %%zm%% /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Optimized" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Optimized" +# PROP BASE Intermediate_Dir "Optimized" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Optimized" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Optimized" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MTd /W4 /WX %%minimalRebuild%% /GR /GX %%dbgInfo_o%% %%optimizedOptimizations%% /Gf %%includeDirectories_optimized%% %%defines_optimized%% /Yu"%%pch%%" /FD %%zm%% /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Debug" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W4 /WX %%minimalRebuild%% /GR /GX %%dbgInfo_d%% /Od %%debugInline%% %%includeDirectories_debug%% %%defines_debug%% /Yu"%%pch%%" /FD %%zm%% /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "%%project%% - Win32 Release" +# Name "%%project%% - Win32 Optimized" +# Name "%%project%% - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;rc" +%%sources%% +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "def;h;hpp;inl" +%%headers%% +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +%%resources%% +# End Group +# Begin Group "Template Files" + +# PROP Default_Filter "template" +%%templates%% +# End Group +# End Target +# End Project +@; + +# --------------------------------------------------------------------- + +$template_windows = +q@# Microsoft Developer Studio Project File - Name="%%project%%" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=%%project%% - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "%%project%%.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "%%project%%.mak" CFG="%%project%% - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "%%project%% - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "%%project%% - Win32 Optimized" (based on "Win32 (x86) Application") +!MESSAGE "%%project%% - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "%%project%%" +# PROP Scc_LocalPath "..\.." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "%%project%% - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Release" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W4 /WX /GR /GX %%dbgInfo_r%% /O2 %%includeDirectories_release%% %%defines_release%% /Yu"%%pch%%" /FD %%zm%% /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 %%libraries_release%% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 %%ignoreLibraries_release%% /out:"..\..\..\..\..\..\compile\win32\%%project%%\Release\%%project%%_r.exe" /pdbtype:sept %%libraryDirectories_release%% %%incremental_r%% +# SUBTRACT LINK32 /pdb:none +%%specialBuildTool_release%% + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Optimized" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Optimized" +# PROP BASE Intermediate_Dir "Optimized" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Optimized" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Optimized" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MTd /W4 /WX %%minimalRebuild%% /GR /GX %%dbgInfo_o%% %%optimizedOptimizations%% /Gf %%includeDirectories_optimized%% %%defines_optimized%% /Yu"%%pch%%" /FD %%zm%% /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 %%libraries_optimized%% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 %%ignoreLibraries_optimized%% /out:"..\..\..\..\..\..\compile\win32\%%project%%\Optimized\%%project%%_o.exe" /pdbtype:sept %%libraryDirectories_optimized%% %%incremental_o%% +# SUBTRACT LINK32 /pdb:none +%%specialBuildTool_optimized%% + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Debug" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W4 /WX %%minimalRebuild%% /GR /GX %%dbgInfo_d%% /Od %%debugInline%% %%includeDirectories_debug%% %%defines_debug%% /Yu"%%pch%%" /FD %%zm%% /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 %%libraries_debug%% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 %%ignoreLibraries_debug%% /out:"..\..\..\..\..\..\compile\win32\%%project%%\Debug\%%project%%_d.exe" /pdbtype:sept %%libraryDirectories_debug%% %%incremental_d%% +# SUBTRACT LINK32 /pdb:none +%%specialBuildTool_debug%% + +!ENDIF + +# Begin Target + +# Name "%%project%% - Win32 Release" +# Name "%%project%% - Win32 Optimized" +# Name "%%project%% - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;rc" +%%sources%% +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "def;h;hpp;inl" +%%headers%% +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +%%resources%% +# End Group +# Begin Group "Template Files" + +# PROP Default_Filter "template" +%%templates%% +# End Group +# Begin Group "Ui Files" + +# PROP Default_Filter "ui" +%%uis%% +# End Group +# Begin Group "Ui Generated Files" + +# PROP Default_Filter "" +# Begin Group "Release" + +# PROP Default_Filter "" +# Begin Group "Release Ui Source Files" + +# PROP Default_Filter "" +%%uiGeneratedSources_release%% +# End Group +# Begin Group "Release Ui HeaderFiles" + +# PROP Default_Filter "" +%%uiGeneratedHeaders_release%% +# End Group +# End Group +# Begin Group "Optimized" + +# PROP Default_Filter "" +# Begin Group "Optimized Ui Source Files" + +# PROP Default_Filter "" +%%uiGeneratedSources_optimized%% +# End Group +# Begin Group "Optimized Ui Header Files" + +# PROP Default_Filter "" +%%uiGeneratedHeaders_optimized%% +# End Group +# End Group +# Begin Group "Debug" + +# PROP Default_Filter "" +# Begin Group "Debug Ui Source Files" + +# PROP Default_Filter "" +%%uiGeneratedSources_debug%% +# End Group +# Begin Group "Debug Ui Header Files" + +# PROP Default_Filter "" +%%uiGeneratedHeaders_debug%% +# End Group +# End Group +# End Group +# End Target +# End Project +@; + + +# --------------------------------------------------------------------- + +$template_mfc = +q@# Microsoft Developer Studio Project File - Name="%%project%%" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=%%project%% - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "%%project%%.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "%%project%%.mak" CFG="%%project%% - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "%%project%% - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "%%project%% - Win32 Optimized" (based on "Win32 (x86) Application") +!MESSAGE "%%project%% - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "%%project%%" +# PROP Scc_LocalPath "..\.." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "%%project%% - Win32 Release" + +# PROP BASE Use_MFC 5 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 5 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Release" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W4 /WX /GR /GX %%dbgInfo_r%% /O2 %%includeDirectories_release%% %%defines_release%% /Yu"%%pch%%" /FD %%zm%% /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 +# ADD LINK32 %%libraries_release%% /nologo /subsystem:windows /debug /machine:I386 %%ignoreLibraries_release%% /out:"..\..\..\..\..\..\compile\win32\%%project%%\Release\%%project%%_r.exe" /pdbtype:sept %%libraryDirectories_release%% %%incremental_r%% +# SUBTRACT LINK32 /pdb:none +%%specialBuildTool_release%% + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Optimized" + +# PROP BASE Use_MFC 5 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Optimized" +# PROP BASE Intermediate_Dir "Optimized" +# PROP BASE Target_Dir "" +# PROP Use_MFC 5 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Optimized" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Optimized" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MTd /W4 /WX %%minimalRebuild%% /GR /GX %%dbgInfo_o%% %%optimizedOptimizations%% /Gf %%includeDirectories_optimized%% %%defines_optimized%% /Yu"%%pch%%" /FD %%zm%% /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 %%libraries_optimized%% /nologo /subsystem:windows /debug /machine:I386 %%ignoreLibraries_optimized%% /out:"..\..\..\..\..\..\compile\win32\%%project%%\Optimized\%%project%%_o.exe" /pdbtype:sept %%libraryDirectories_optimized%% %%incremental_o%% +# SUBTRACT LINK32 /pdb:none +%%specialBuildTool_optimized%% + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Debug" + +# PROP BASE Use_MFC 5 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 5 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Debug" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W4 /WX %%minimalRebuild%% /GR /GX %%dbgInfo_d%% /Od %%debugInline%% %%includeDirectories_debug%% %%defines_debug%% /Yu"%%pch%%" /FD %%zm%% /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 %%libraries_debug%% /nologo /subsystem:windows /debug /machine:I386 %%ignoreLibraries_debug%% /out:"..\..\..\..\..\..\compile\win32\%%project%%\Debug\%%project%%_d.exe" /pdbtype:sept %%libraryDirectories_debug%% %%incremental_d%% +# SUBTRACT LINK32 /pdb:none +%%specialBuildTool_debug%% + +!ENDIF + +# Begin Target + +# Name "%%project%% - Win32 Release" +# Name "%%project%% - Win32 Optimized" +# Name "%%project%% - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;rc" +%%sources%% +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "def;h;hpp;inl" +%%headers%% +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +%%resources%% +# End Group +# Begin Group "Template Files" + +# PROP Default_Filter "template" +%%templates%% +# End Group +# End Target +# End Project +@; + +# --------------------------------------------------------------------- + +$template_console = +q@# Microsoft Developer Studio Project File - Name="%%project%%" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=%%project%% - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "%%project%%.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "%%project%%.mak" CFG="%%project%% - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "%%project%% - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "%%project%% - Win32 Optimized" (based on "Win32 (x86) Console Application") +!MESSAGE "%%project%% - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "%%project%%" +# PROP Scc_LocalPath "..\.." +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "%%project%% - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Release" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W4 /WX /GR /GX %%dbgInfo_r%% /O2 %%includeDirectories_release%% %%defines_release%% /Yu"%%pch%%" /FD %%zm%% /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 %%libraries_release%% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 %%ignoreLibraries_release%% /out:"..\..\..\..\..\..\compile\win32\%%project%%\Release\%%project%%_r.exe" /pdbtype:sept %%libraryDirectories_release%% %%incremental_r%% +# SUBTRACT LINK32 /pdb:none +%%specialBuildTool_release%% + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Optimized" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Optimized" +# PROP BASE Intermediate_Dir "Optimized" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Optimized" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Optimized" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /G6 /MTd /W4 /WX %%minimalRebuild%% /GR /GX %%dbgInfo_o%% %%optimizedOptimizations%% /Gf %%includeDirectories_optimized%% %%defines_optimized%% /Yu"%%pch%%" /FD %%zm%% /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 %%libraries_optimized%% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 %%ignoreLibraries_optimized%% /out:"..\..\..\..\..\..\compile\win32\%%project%%\Optimized\%%project%%_o.exe" /pdbtype:sept %%libraryDirectories_optimized%% %%incremental_o%% +# SUBTRACT LINK32 /pdb:none +%%specialBuildTool_optimized%% + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Debug" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /G6 /MTd /W4 /WX %%minimalRebuild%% /GR /GX %%dbgInfo_d%% /Od %%debugInline%% %%includeDirectories_debug%% %%defines_debug%% /Yu"%%pch%%" /FD %%zm%% /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 %%libraries_debug%% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 %%ignoreLibraries_debug%% /out:"..\..\..\..\..\..\compile\win32\%%project%%\Debug\%%project%%_d.exe" /pdbtype:sept %%libraryDirectories_debug%% %%incremental_d%% +# SUBTRACT LINK32 /pdb:none +%%specialBuildTool_debug%% + +!ENDIF + +# Begin Target + +# Name "%%project%% - Win32 Release" +# Name "%%project%% - Win32 Optimized" +# Name "%%project%% - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;rc" +%%sources%% +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "def;h;hpp;inl" +%%headers%% +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +%%resources%% +# End Group +# Begin Group "Template Files" + +# PROP Default_Filter "template" +%%templates%% +# End Group +# End Target +# End Project +@; + +# --------------------------------------------------------------------- + +$template_utility = +q@# Microsoft Developer Studio Project File - Name="%%project%%" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=%%project%% - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "%%project%%.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "%%project%%.mak" CFG="%%project%% - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "%%project%% - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "%%project%% - Win32 Optimized" (based on "Win32 (x86) Generic Project") +!MESSAGE "%%project%% - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "%%project%%" +# PROP Scc_LocalPath "..\.." +MTL=midl.exe + +!IF "$(CFG)" == "%%project%% - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Release" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Release" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Optimized" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Debug" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Debug" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Debug" +# PROP Intermediate_Dir "..\..\..\..\..\..\compile\win32\%%project%%\Debug" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "%%project%% - Win32 Release" +# Name "%%project%% - Win32 Optimized" +# Name "%%project%% - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;rc" +%%sources%% +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "def;h;hpp;inl" +%%headers%% +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +%%resources%% +# End Group +# Begin Group "Template Files" + +# PROP Default_Filter "template" +%%templates%% +# End Group +# End Target +# End Project +@; + +# --------------------------------------------------------------------- + +$mocHeader= q@ +!IF "$(CFG)" == "%%project%% - Win32 Release" + +# Begin Custom Build - moc $(InputName) +TargetDir=..\..\..\..\..\..\compile\win32\%%project%%\Release +InputPath=%%inputPath%% +InputName=%%inputName%% + +"$(TargetDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + ..\..\..\..\..\..\external\3rd\library\qt\%%qt_version%%\bin\moc -i $(InputPath) -o $(TargetDir)\$(InputName).moc + +# End Custom Build + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Optimized" + +# Begin Custom Build - moc $(InputName) +TargetDir=..\..\..\..\..\..\compile\win32\%%project%%\Optimized +InputPath=%%inputPath%% +InputName=%%inputName%% + +"$(TargetDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + ..\..\..\..\..\..\external\3rd\library\qt\%%qt_version%%\bin\moc -i $(InputPath) -o $(TargetDir)\$(InputName).moc + +# End Custom Build + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Debug" + +# Begin Custom Build - moc $(InputName) +TargetDir=..\..\..\..\..\..\compile\win32\%%project%%\Debug +InputPath=%%inputPath%% +InputName=%%inputName%% + +"$(TargetDir)\$(InputName).moc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + ..\..\..\..\..\..\external\3rd\library\qt\%%qt_version%%\bin\moc -i $(InputPath) -o $(TargetDir)\$(InputName).moc + +# End Custom Build + +!ENDIF +@; + +# --------------------------------------------------------------------- + +$ui = q@ +!IF "$(CFG)" == "%%project%% - Win32 Release" + +# Begin Custom Build - ui $(InputName) +TargetDir=..\..\..\..\..\..\compile\win32\%%project%%\Release +InputPath=%%inputPath%% +InputName=%%inputName%% + +BuildCmds= \ + ..\..\..\..\..\..\external\3rd\library\qt\%%qt_version%%\bin\uic -o $(TargetDir)\$(InputName).h $(InputPath) \ + ..\..\..\..\..\..\external\3rd\library\qt\%%qt_version%%\bin\uic -o $(TargetDir)\$(InputName)_r.cpp -impl $(TargetDir)\$(InputName).h $(InputPath) \ + ..\..\..\..\..\..\external\3rd\library\qt\%%qt_version%%\bin\moc $(TargetDir)\$(InputName).h >> $(TargetDir)\$(InputName)_r.cpp + +"$(TargetDir)/$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(TargetDir)/$(InputName)_r.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Optimized" + +# Begin Custom Build - ui $(InputName) +TargetDir=..\..\..\..\..\..\compile\win32\%%project%%\Optimized +InputPath=%%inputPath%% +InputName=%%inputName%% + +BuildCmds= \ + ..\..\..\..\..\..\external\3rd\library\qt\%%qt_version%%\bin\uic -o $(TargetDir)\$(InputName).h $(InputPath) \ + ..\..\..\..\..\..\external\3rd\library\qt\%%qt_version%%\bin\uic -o $(TargetDir)\$(InputName)_o.cpp -impl $(TargetDir)\$(InputName).h $(InputPath) \ + ..\..\..\..\..\..\external\3rd\library\qt\%%qt_version%%\bin\moc $(TargetDir)\$(InputName).h >> $(TargetDir)\$(InputName)_o.cpp + +"$(TargetDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(TargetDir)\$(InputName)_o.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Debug" + +# Begin Custom Build - ui $(InputName) +TargetDir=..\..\..\..\..\..\compile\win32\%%project%%\Debug +InputPath=%%inputPath%% +InputName=%%inputName%% + +BuildCmds= \ + ..\..\..\..\..\..\external\3rd\library\qt\%%qt_version%%\bin\uic -o $(TargetDir)\$(InputName).h $(InputPath) \ + ..\..\..\..\..\..\external\3rd\library\qt\%%qt_version%%\bin\uic -o $(TargetDir)\$(InputName)_d.cpp -impl $(TargetDir)\$(InputName).h $(InputPath) \ + ..\..\..\..\..\..\external\3rd\library\qt\%%qt_version%%\bin\moc $(TargetDir)\$(InputName).h >> $(TargetDir)\$(InputName)_d.cpp + +"$(TargetDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"$(TargetDir)\$(InputName)_d.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + +!ENDIF + +@; + +# --------------------------------------------------------------------- + +$release_ui_cpp = q@ +!IF "$(CFG)" == "%%project%% - Win32 Release" + +# ADD CPP /W3 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Optimized" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Debug" + +# PROP Exclude_From_Build 1 + +!ENDIF +@; + +$optimized_ui_cpp = q@ +!IF "$(CFG)" == "%%project%% - Win32 Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Optimized" + +# ADD CPP /W3 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Debug" + +# PROP Exclude_From_Build 1 + +!ENDIF +@; + +$debug_ui_cpp = q@ +!IF "$(CFG)" == "%%project%% - Win32 Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Optimized" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "%%project%% - Win32 Debug" + +# ADD CPP /W3 +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF +@; + +# --------------------------------------------------------------------- + +$specialBuildTool_release = +q@# Begin Special Build Tool +TargetPath=..\..\..\..\..\..\compile\win32\%%project%%\Release\%%project%%_r.exe +SOURCE="$(InputPath)" +%%preLink_release%% +%%postBuild_release%% +# End Special Build Tool +@; + +$specialBuildTool_optimized = +q@# Begin Special Build Tool +TargetPath=..\..\..\..\..\..\compile\win32\%%project%%\Optimized\%%project%%_o.exe +SOURCE="$(InputPath)" +%%preLink_optimized%% +%%postBuild_optimized%% +# End Special Build Tool +@; + +$specialBuildTool_debug = +q@# Begin Special Build Tool +TargetPath=..\..\..\..\..\..\compile\win32\%%project%%\Debug\%%project%%_d.exe +SOURCE="$(InputPath)" +%%preLink_debug%% +%%postBuild_debug%% +# End Special Build Tool +@; + +$postBuild_release = +q@PostBuild_Desc=Post build steps +PostBuild_Cmds=%%copyDev_release%% +@; + +$postBuild_optimized= +q@PostBuild_Desc=Post build steps +PostBuild_Cmds=%%copyDev_optimized%% +@; + +$postBuild_debug = +q@PostBuild_Desc=Post build steps +PostBuild_Cmds=%%copyDev_debug%% +@; + +$resourceDebugLevels = +q@ +!IF "$(CFG)" == "SwgClient - Win32 Release" + +# ADD BASE RSC /l 0x409 /i "\work\swg\live\src\game\client\application\SwgClient\src\win32" /i "\work\swg\current\src\game\client\application\SwgClient\src\win32" +# ADD RSC /l 0x409 /i "\work\swg\live\src\game\client\application\SwgClient\src\win32" /i "\work\swg\current\src\game\client\application\SwgClient\src\win32" /d DEBUG_LEVEL=0 + +!ELSEIF "$(CFG)" == "SwgClient - Win32 Optimized" + +# ADD BASE RSC /l 0x409 /i "\work\swg\live\src\game\client\application\SwgClient\src\win32" /i "\work\swg\current\src\game\client\application\SwgClient\src\win32" +# ADD RSC /l 0x409 /i "\work\swg\live\src\game\client\application\SwgClient\src\win32" /i "\work\swg\current\src\game\client\application\SwgClient\src\win32" /d DEBUG_LEVEL=1 + +!ELSEIF "$(CFG)" == "SwgClient - Win32 Debug" + +# ADD BASE RSC /l 0x409 /i "\work\swg\live\src\game\client\application\SwgClient\src\win32" /i "\work\swg\current\src\game\client\application\SwgClient\src\win32" +# ADD RSC /l 0x409 /i "\work\swg\live\src\game\client\application\SwgClient\src\win32" /i "\work\swg\current\src\game\client\application\SwgClient\src\win32" /d DEBUG_LEVEL=2 + +!ENDIF + +@; + +# --------------------------------------------------------------------- + +} diff --git a/gameserver/utils/tools/BuildFunctions.pm b/gameserver/utils/tools/BuildFunctions.pm new file mode 100644 index 0000000..2fac035 --- /dev/null +++ b/gameserver/utils/tools/BuildFunctions.pm @@ -0,0 +1,278 @@ +package BuildFunctions; + +require Exporter; + +our @ISA = qw(Exporter); +our @EXPORT = qw(build_project Check_For_Warnings_and_Errors get_time_and_date get_date); + + + +### + # Copyright (C)2000-2002 Sony Online Entertainment Inc. + # All Rights Reserved + # + # Title: BuildFunctions.pl + # Description: This file contains the various functions used by the different build scripts. + # @author $Author: gmcdaniel $ + # @version $Revision: #1 $ + ## + + + + + + +#todo Possible failure points that I need to fix. The ResultsLogfile file can fail to be opened in one sub but still try to be written to in Check_Logfile_For_Warnings_and_Errors +#todo Bad coding to call ResultsLogFile without acutally passing it in to the sub? Probably + + + +## +# This subroutine builds the passed project. It is passed the project name, the string for the project to build, and the project type (release or debug) + +sub build +{ + print ("Beginning $_[1] build...\n"); + system("msdev ..\\src\\build\\win32\\swg.dsw /MAKE \"$_[1]\" /y3 /REBUILD /OUT d:\\buildlogs\\$_[0]_$_[2].log"); + print ("$_[1] build complete\n"); + print ("\n"); + $timestamp = get_time_and_date(); + $timeStamped_Log = $_[0]."_".$_[2]."_".$timestamp.".log"; + system ("copy d:\\buildlogs\\$_[0]_$_[2].log d:\\buildlogs\\$timeStamped_Log"); + print ("\n"); + print ("\n"); + + +} # End of sub build + + + + +## +# This subroutine calls the build subroutine to build both the release and debug versions of the project that is passed + +sub build_project +{ + + $project = $_[0]." - Win32 Release"; + $type = "Release"; + build($_[0],$project,$type); + + + $project = $_[0]." - Win32 Debug"; + $type = "Debug"; + build($_[0],$project,$type); + + + $project = $_[0]." - Win32 Optimized"; + $type = "Optimized"; + build($_[0],$project,$type); + +} # End of sub build_project + + + + +## +# This subroutine returns the current local time and date + +sub get_time_and_date +{ + ($sec, $min, $hour, $day, $month, $year) = (localtime) [0,1,2,3,4,5]; + $month = $month + 1; + $year = $year + 1900; + $dayandtime = $month."_".$day."_".$year."__".$hour."_".$min."_".$sec; + return $dayandtime; + +} # End of sub get_time_and_date + + + + +## +# This subroutine returns the current local date + +sub get_date +{ + ($day, $month, $year) = (localtime) [3,4,5]; + $month = $month + 1; + $year = $year + 1900; + $date = $month."/".$day."/".$year; + return $date; + +} # End of sub get_date + + + + +## +# This subroutine checks for warnings and errors in the build logs. If there is an error it returns true otherwise it returns false. +# It takes the name the logfile to check and the resulting exe or project name as input. + +sub Check_Logfile_For_Warnings_and_Errors +{ + + $third_to_last_line = "test_line_3"; + $second_to_last_line = "test_line_2"; + + open (Logfile,"d:\\buildlogs\\$_[0]") || die "Cannot open $_[0] for reading."; + while () + { + chomp; + $third_to_last_line = $second_to_last_line; + $second_to_last_line = $_; + } + close (Logfile) || die "can't close $_[0]"; + print ("\n"); + print ("$third_to_last_line\n"); + print ("$second_to_last_line\n"); + print ResultsLogfile ("$third_to_last_line\n"); + print ResultsLogfile ("$second_to_last_line\n"); + print ResultsLogfile ("\n"); + + + + + $search_for_errors= "0 error"; + $search_for_warnings= "0 warning"; + $match=-1; + + #check for 0 errors. + if (index($third_to_last_line, $search_for_errors,$match) > -1) { + print ("No errors Found in $_[0]\n"); + print ("\n"); + + #check for warnings + if (index($third_to_last_line, $search_for_warnings,$match) > -1) { + #no warnings or errors found + print ("No Warnings Found in $_[0]\n"); + print ("\n"); + return "false"; + } + #a warning was found + print ("Warning Found in $_[0]\n"); + print ("\n"); + return "true"; + } + + #an error was found + else { + print ("Error Found in $_[0]\n"); + print ("\n"); + return "true"; + } + + +} # End of sub Check_Logfile_For_Warnings_and_Errors + + + + +## +# This subroutine checks for warnings and errors in the build logs. If there is an error or warning it notifies QA and the lead programmers. +# If there is not an error or warning then the build log is just sent to QA. +# It takes the name of the project and the resulting exe or project name as input. + +sub Check_For_Warnings_and_Errors +{ + + print ("Checking for errors and warnings...\n"); + print ("\n"); + + # create file to store warnings and errors for inclusion in body of email. + open (ResultsLogfile, ">d:\\buildlogs\\$_[0]Results.log") || die "Sorry, I couldn't create $_[0]Results.log"; + + + + # Prints to results file for easier email formatting + print ResultsLogfile ("\n"); + print ResultsLogfile ("Release Build:\n"); + + + # Checks for errors or warnings in the release build + $Logfile_to_check = $_[0]."_Release.log"; + $ReleaseError = Check_Logfile_For_Warnings_and_Errors($Logfile_to_check); + + + # Prints to results file for easier email formatting + print ResultsLogfile ("\n"); + print ResultsLogfile ("Debug Build:\n"); + + + # Checks for errors or warnings in the debug build + $Logfile_to_check = $_[0]."_Debug.log"; + $DebugError = Check_Logfile_For_Warnings_and_Errors($Logfile_to_check); + + + + # Prints to results file for easier email formatting + print ResultsLogfile ("\n"); + print ResultsLogfile ("Optimized Build:\n"); + + + # Checks for errors or warnings in the debug build + $Logfile_to_check = $_[0]."_Optimized.log"; + $OptimizedError = Check_Logfile_For_Warnings_and_Errors($Logfile_to_check); + + + # Closes file used for the number of errors and warnings + close (ResultsLogfile); + + + + + + # Email addresses + $gmcdaniel = "gmcdaniel\@soe.sony.com"; + $jbrack = "jbrack\@soe.sony.com"; + $jgrills = "jgrills\@soe.sony.com"; + $asommers = "asommers\@soe.sony.com"; + $cmayer = "cmayer\@soe.sony.com"; + $prog_leads = "-to:$gmcdaniel -to:$jgrills -to:$cmayer -to:$asommers -cc:$jbrack"; + + + + $date_stamp = get_date(); + + if ($ReleaseError eq "true") + { + print ("Error or warning found in $_[0] Release Log. Emailing appropriate people.\n"); + + # Email the results to Programmer Leads and QA + system ("postie -host:sdt-mx1.station.sony.com $prog_leads -from:$gmcdaniel -s:\"[BUILDLOG] Errors or Warnings in Daily $_[0] Build Logs $date_stamp\" -nomsg -file:d:\\buildlogs\\$_[0]Results.log -a:d:\\buildlogs\\$_[0]_Release.log -a:d:\\buildlogs\\$_[0]_Debug.log -a:d:\\buildlogs\\$_[0]_Optimized.log"); + } + + elsif ($DebugError eq "true") + { + print ("Error or warning found in $_[0] Debug Log. Emailing appropriate people.\n"); + + # Email the results to Programmer Leads and QA + system ("postie -host:sdt-mx1.station.sony.com $prog_leads -from:$gmcdaniel -s:\"[BUILDLOG] Errors or Warnings in Daily $_[0] Build Logs $date_stamp\" -nomsg -file:d:\\buildlogs\\$_[0]Results.log -a:d:\\buildlogs\\$_[0]_Release.log -a:d:\\buildlogs\\$_[0]_Debug.log -a:d:\\buildlogs\\$_[0]_Optimized.log"); + } + + elsif ($OptimizedError eq "true") + { + print ("Error or warning found in $_[0] Optimized Log. Emailing appropriate people.\n"); + + # Email the results to Programmer Leads and QA + system ("postie -host:sdt-mx1.station.sony.com $prog_leads -from:$gmcdaniel -s:\"[BUILDLOG] Errors or Warnings in Daily $_[0] Build Logs $date_stamp\" -nomsg -file:d:\\buildlogs\\$_[0]Results.log -a:d:\\buildlogs\\$_[0]_Release.log -a:d:\\buildlogs\\$_[0]_Debug.log -a:d:\\buildlogs\\$_[0]_Optimized.log"); + } + + else + { + print ("No errors or warnings found in $_[0] logs."); + + # Email the results to QA and Programmer Leads + system ("postie -host:sdt-mx1.station.sony.com $prog_leads -from:$gmcdaniel -s:\"[BUILDLOG] $_[0] Build Successful $date_stamp\" -nomsg -file:d:\\buildlogs\\$_[0]Results.log"); + } + + + + print ("End of errors and warning check for $_[0] logs.\n"); + print ("\n"); + + +} # End of sub Check_For_Warnings_and_Errors + + +1; diff --git a/gameserver/utils/tools/BuildLivePatchTreeFromChangelists.pl b/gameserver/utils/tools/BuildLivePatchTreeFromChangelists.pl new file mode 100755 index 0000000..40fcda9 --- /dev/null +++ b/gameserver/utils/tools/BuildLivePatchTreeFromChangelists.pl @@ -0,0 +1,68 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +sub numerically +{ + $a <=> $b; +} + +# check command line arguments +if (@ARGV < 2 || ($ARGV[0] =~ /^[-\/]/) || !($ARGV[0] =~ /tre$/i)) +{ + die "usage: $0 [treefile.tre] [changelist ...]\n"; +} + +my $tre = shift; + +# process all changelists gathering up files for the TRE +print "Processing changelists\n"; +my %file; +foreach my $changelist (sort numerically @ARGV) +{ + print "\t$changelist\n"; + open(P4, "p4 describe -s $changelist |"); + while () + { + chomp; + if (s%^\.\.\. //depot/swg/live/(data/sku.\d+/sys.(client|shared)/[^\/]+/[^\/]+)/%%) + { + my $prefix = $1; + s/#\d+ .*//; + $file{$_} = "../../$prefix/" . $_; + + } + } + close(P4); +} +print"\n"; + +# generate the tree file response file +print "Generating response file\n"; +my $rsp = $tre; +$rsp =~ s/tre$/rsp/i; +open(RSP, ">" . $rsp); +foreach (sort keys %file) +{ + print "\t", $_, " @ ", $file{$_}, "\n"; + print RSP $_, " @ ", $file{$_}, "\n"; +} +close(RSP); +print"\n"; + +# build the tree file +print "Generating tree file\n"; +open(TRE, "TreeFileBuilder -r $rsp $tre |"); +print "\t", $_ while (); +close(TRE); +print "\n"; + +# generate the md5sum for the file +print "Generating md5sum\n"; +my $md5 = $tre; +$md5 =~ s/tre$/md5/i; +system("md5sum -b $tre > $md5"); +open(MD5, $md5); +print "\t", $_ while (); +close(MD5); diff --git a/gameserver/utils/tools/BuildVcproj.pl b/gameserver/utils/tools/BuildVcproj.pl new file mode 100755 index 0000000..2b6aca2 --- /dev/null +++ b/gameserver/utils/tools/BuildVcproj.pl @@ -0,0 +1,2553 @@ +#!/usr/bin/perl +# ===================================================================== + +# figure out what project file we're building +$project = $ARGV[0]; +die "no project name specified" if (!defined($project)); + +# lop off the directories +$project =~ s#^.*[/\\]##; + +# lop off the extension +$project =~ s#\.vcproj$##; + +# capitalize the first letter of the string +$Project = $project; +substr($Project,0,1) =~ tr/a-z/A-Z/; + +# get the directory path, paths need to be relative to the project files +$directory = $ARGV[0]; +if ($directory =~ s#[/\\][^/\\]+$## != 0) +{ + chdir($directory) || die "could not change into directory ". $directory; +} + +# ===================================================================== + +# setup defaults +@defines_debug = ("WIN32", "_DEBUG", "_MBCS", "DEBUG_LEVEL=2", "_CRT_SECURE_NO_DEPRECATE=1", "_USE_32BIT_TIME_T=1"); +@defines_optimized = ("WIN32", "_DEBUG", "_MBCS", "DEBUG_LEVEL=1", "_CRT_SECURE_NO_DEPRECATE=1", "_USE_32BIT_TIME_T=1"); +@defines_release = ("WIN32", "NDEBUG", "_MBCS", "DEBUG_LEVEL=0", "_CRT_SECURE_NO_DEPRECATE=1", "_USE_32BIT_TIME_T=1"); + +$opt_optimizationLevel = "3"; +$opt_intrinsicFunctions = "TRUE"; +$opt_sizeOrSpeed = "1"; + +$fixMfc = 0; +$fixQt = 0; + +$dbgInfo_d = makeDebugInfoFlag("pdb"); +$dbgInfo_o = makeDebugInfoFlag("pdb"); +$dbgInfo_r = makeDebugInfoFlag("pdb"); +$incremental_d = makeIncrementalLinkFlag("yes"); +$incremental_o = makeIncrementalLinkFlag("yes"); +$incremental_r = makeIncrementalLinkFlag("no"); +$minimalRebuild = "TRUE"; +$debugInline = "0"; + +# ===================================================================== +# process RSP files + +open(RSP, "settings.rsp") || die "could not open settings.rsp for " . $project . ", "; +while () +{ + # handle comments + s/#.*//; + + foreach (split) + { + if ($_ eq "windows") + { + $output = $template_windows; + push(@defines_debug, "_WINDOWS"); + push(@defines_optimized, "_WINDOWS"); + push(@defines_release, "_WINDOWS"); + } + elsif ($_ eq "mfc") + { + $output = $template_mfc; + push(@defines_debug, "_WINDOWS"); + push(@defines_optimized, "_WINDOWS"); + push(@defines_release, "_WINDOWS"); + + # Don't fix mfc paths. We want to compile using mfc, not atlmfc + # $fixMfc = 1; + } + elsif ($_ eq "qt334" || $_ eq "qt") + { + $output = $template_qt; + push(@defines_debug, "_WINDOWS", "QT_DLL", "QT_NO_STL", "QT_ACCESSIBILITY_SUPPORT"); + push(@defines_optimized, "_WINDOWS", "QT_DLL", "QT_NO_STL", "QT_ACCESSIBILITY_SUPPORT"); + push(@defines_release, "_WINDOWS", "QT_DLL", "QT_NO_STL", "QT_ACCESSIBILITY_SUPPORT"); + $qt_version = "3.3.4"; + $fixQt = 1; + } + elsif ($_ eq "console") + { + $output = $template_console; + push(@defines_debug, "_CONSOLE"); + push(@defines_optimized, "_CONSOLE"); + push(@defines_release, "_CONSOLE"); + } + elsif ($_ eq "library") + { + $output = $template_library; + + push(@defines_debug, "_LIB"); + push(@defines_optimized, "_LIB"); + push(@defines_release, "_LIB"); + } + elsif ($_ eq "utility") + { + $output = $template_utility; + } + elsif ($_ eq "noPchDirectory") + { + $noPchDir = 1; + } + elsif ($_ eq "stdafx") + { + $stdafx = 1; + } + elsif ($_ eq "noPch") + { + $noPch = 1; + } + elsif ($_ eq "p4") + { + push(@defines_debug, "CASE_INSENSITIVE", "OS_NT"); + push(@defines_optimized, "CASE_INSENSITIVE", "OS_NT"); + push(@defines_release, "CASE_INSENSITIVE", "OS_NT"); + } + elsif ($_ eq "unicode") + { + push(@defines_debug, "_UNICODE", "UNICODE"); + push(@defines_optimized, "_UNICODE", "UNICODE"); + push(@defines_release, "_UNICODE", "UNICODE"); + } + elsif (s/^Zm//) + { + $zm = " /Zm" . $_ . " "; + } + elsif (/^dbgInfo_/) + { + print "ignoring $_ directive\n"; + } + #elsif (s/^dbgInfo_d_//) + #{ + # $dbgInfo_d = makeDebugInfoFlag($_); + #} + #elsif (s/^dbgInfo_o_//) + #{ + # $dbgInfo_o = makeDebugInfoFlag($_); + #} + #elsif (s/^dbgInfo_r_//) + #{ + # $dbgInfo_r = makeDebugInfoFlag($_); + #} + elsif (/^incremental_/) + { + print "ignoring $_ directive\n"; + } + #elsif (s/^incremental_d_//) + #{ + # $incremental_d = makeIncrementalLinkFlag($_); + #} + #elsif (s/^incremental_o_//) + #{ + # $incremental_o = makeIncrementalLinkFlag($_); + #} + #elsif (s/^incremental_r_//) + #{ + # $incremental_r = makeIncrementalLinkFlag($_); + #} + elsif (/Gm-/) + { + $minimalRebuild = "FALSE"; + } + elsif ($_ eq "copyDev") + { + $copyDev = 1; + } + elsif ($_ eq "debugInline") + { + $debugInline = "1"; + } + elsif ($_ eq "disableOptimizationsInOpt") + { + $opt_optimizationLevel = "0"; + $opt_intrinsicFunctions = "FALSE"; + $opt_sizeOrSpeed = "0"; + } + elsif ($_ eq "versionNumber") + { + $versionNumber = 1; + } + elsif ($_ eq "versionResource") + { + $versionResource = 1; + } + else + { + die "unknown option ", $_, "\n"; + } + } +} +close(RSP); + +# read in the includes list +push(@defines_debug, process_rsp("defines_d.rsp", "defines.rsp")); +push(@defines_optimized, process_rsp("defines_o.rsp", "defines.rsp")); +push(@defines_release, process_rsp("defines_r.rsp", "defines.rsp")); + +# read in the includes list +@includeDirectories_debug = process_rsp("includePaths_d.rsp", "includePaths.rsp"); +@includeDirectories_optimized = process_rsp("includePaths_o.rsp", "includePaths.rsp"); +@includeDirectories_release = process_rsp("includePaths_r.rsp", "includePaths.rsp"); + +# get in the libraries +@libraries_debug = process_rsp("libraries_d.rsp", "libraries.rsp"); +@libraries_optimized = process_rsp("libraries_o.rsp", "libraries.rsp"); +@libraries_release = process_rsp("libraries_r.rsp", "libraries.rsp"); + +# get the libraries to ignore +@ignoreLibraries_debug = process_rsp("ignoreLibraries_d.rsp", "ignoreLibraries.rsp"); +@ignoreLibraries_optimized = process_rsp("ignoreLibraries_o.rsp", "ignoreLibraries.rsp"); +@ignoreLibraries_release = process_rsp("ignoreLibraries_r.rsp", "ignoreLibraries.rsp"); + +# get the libraries search directory paths +@libraryDirectories_debug = process_rsp("libraryPaths_d.rsp", "libraryPaths.rsp"); +@libraryDirectories_optimized = process_rsp("libraryPaths_o.rsp", "libraryPaths.rsp"); +@libraryDirectories_release = process_rsp("libraryPaths_r.rsp", "libraryPaths.rsp"); + +if ($fixMfc) +{ + fixup_mfc_path(@includeDirectories_debug); + fixup_mfc_path(@includeDirectories_optimized); + fixup_mfc_path(@includeDirectories_release); + fixup_mfc_path(@libraryDirectories_debug); + fixup_mfc_path(@libraryDirectories_optimized); + fixup_mfc_path(@libraryDirectories_release); +} + + +if ($fixQt) +{ + fixup_qt_path(@includeDirectories_debug); + fixup_qt_path(@includeDirectories_optimized); + fixup_qt_path(@includeDirectories_release); + fixup_qt_path(@libraryDirectories_debug); + fixup_qt_path(@libraryDirectories_optimized); + fixup_qt_path(@libraryDirectories_release); + + fixup_qt_lib(@libraries_debug); + fixup_qt_lib(@libraries_optimized); + fixup_qt_lib(@libraries_release); +} + + +# ===================================================================== +# scan the current vcproj looking for per-file settings to preserve + +if (open(VCPROJ, $project . ".vcproj")) +{ + while () + { + # remember the guid + if (/ProjectGUID/) + { + chomp; + s/^.*{//; + s/}.*$//; + + $guid = $_; + } + + # eat a > line + if ($state == 2) + { + if (/^\t+>$/) + { + s/^.*$//; + chomp; + } + $state = 3; + } + # look for per-file settings to preserve + if ($state == 3) + { + if (/\/File>/) + { + $state = 0; + } + else + { + $settings{$filename} .= $_; + } + } + if ($state == 1 && /^\t+RelativePath=/) + { + chomp; + s/^[^"]+"//; + s/"[^"]*$//; + $filename = $_; + $state = 2; + } + if (/^\t\t\t; + close(P4); + ($where_depot, $where_client, $where_local) = split; + + # couldn't find it, so make a new guids + open(GUID, $where_local . "|"); + $guid = ; + chomp $guid; + close(GUID); +} +$guid = uc $guid; + +# override the custom build steps for headers that need moc'ed +open(RSP, "mocHeaders.rsp"); +while () +{ + chomp; + + # handle comments + s/#.*//; + + # clean up the input + s/^\s+//; + s/\s+$//; + s#/#\\#g; + + if ($_ ne "") + { + # get just the file name + $name = $_; + $name =~ s#^.*\\##; + $name =~ s#\..*$##; + + $settings{$_} = $mocHeader; + $settings{$_} =~ s/%%inputPath%%/$_/g; + $settings{$_} =~ s/%%inputName%%/$name/g; + } +} +close(RSP); + +# ===================================================================== +# + +sub makeIncrementalLinkFlag +{ + my $input = $_[0]; + local $flag = ""; + local $_; + + if ( $input eq "yes" ) + { + $flag = "2"; + } + elsif ( $input eq "no" ) + { + $flag = "1"; + } + else + { + die "Unknown setting for incremental_link: $input\n"; + } + + return $flag; +} + +# ===================================================================== +# + +sub makeDebugInfoFlag +{ + my $input = $_[0]; + local $flag = ""; + local $_; + + if ( $input eq "line_numbers_only" ) + { + $flag = "2"; + } + elsif ( $input eq "pdb" ) + { + $flag = "3"; + } + elsif ( $input eq "edit_and_continue" ) + { + $flag = "4"; + } + elsif ( $input eq "none" ) + { + $flag = "0"; + } + else + { + die "Unknown setting for dbgInfo: $input\n"; + } + + return $flag; +} + + +sub fixup_mfc_path +{ + foreach (@_) + { + s/library\\mfc/library\\atlmfc/; + } +} + +sub fixup_qt_path +{ + foreach (@_) + { + s/qt\\[0-9]\.[0-9]\.[0-9]/qt\\$qt_version/; + } +} + +sub fixup_qt_lib +{ + my $qtlibver = $qt_version; + $qtlibver =~ s/\.//g; + + foreach (@_) + { + s/qt-mt[0-9][0-9][0-9]/qt-mt$qtlibver/; + } +} + + +# ===================================================================== +# find all the non-linux source files + +sub addfile +{ + my $pathed = $_[0]; + local $_ = $pathed; + + # lop off the directories + s#.*/##; + s#.*\\##; + + if (/\.cpp$/) + { + $sourceNames{$_} = $pathed; + } + elsif (/\.h$/) + { + $headerNames{$_} = $pathed; + } + elsif (/\.def$/) + { + $headerNames{$_} = $pathed; + $settings{$pathed} = $excludeFromBuild; + } + elsif (/\.ui$/) + { + $uiNames{$_} = $pathed; + + $settings{$pathed} = $ui; + $settings{$pathed} =~ s/%%inputPath%%/$pathed/g; + $noExt = $_; + $noExt =~ s/\.ui$//; + $settings{$pathed} =~ s/%%inputName%%/$noExt/g; + } + elsif (/\.template$/) + { + $templateNames{$_} = $pathed; + } + elsif (/\.rc$/) + { + $resourceNames{$_} = $pathed; + $settings{$pathed} = $resourceDebugLevels if ($versionResource); + } + elsif (/\.ico$/ || /\.cur$/ || /\.bmp$/) + { + $resourceNames{$_} = $pathed; + } +} + +sub dodir +{ + local $_; + my $dir = $_[0]; + + opendir(DIR, $dir) || return; + my @filenames = readdir(DIR); + closedir(DIR); + + for (@filenames) + { + next if $_ eq "."; + next if $_ eq ".."; + + $pathed = $dir . "\\" . $_; + + if (-d $pathed) + { + next if ($_ eq "linux"); + next if ($_ eq "solaris"); + &dodir($pathed); + } + else + { + &addfile($pathed); + } + } +} +&dodir("..\\..\\src"); +&dodir("..\\..\\src_oci"); +&dodir("..\\..\\src_odbc"); +&dodir("..\\..\\ui"); + +# get any additional files to include in the build +open(RSP, "additionalFiles.rsp"); +while () +{ + # handle comments + s/#.*//; + + chomp; + s/\s+$//; + &addfile($_) if ($_ ne ""); +} +close(RSP); + +# ===================================================================== +# process all the source files + +# Make sure all First*.cpp projects build the PCH +$settings{$sourceNames{"First$Project.cpp"}} = $createPrecompiledHeader; + +foreach (sort keys %sourceNames) +{ + $_ = $sourceNames{$_}; + $sources .= "\t\t\t\n" . $settings{$_} . "\t\t\t\n"; +} + +foreach (sort keys %headerNames) +{ + $_ = $headerNames{$_}; + $headers .= "\t\t\t\n" . $settings{$_} . "\t\t\t\n"; +} + +foreach (sort keys %resourceNames) +{ + $_ = $resourceNames{$_}; + $resources .= "\t\t\t\n\t\t\t\n"; +} + +foreach (sort keys %uiNames) +{ + # add the ui with the custom build step + $uis .= "\t\t\t + + + + + + + + + + +@; + + $cpp_debug = $_; + $cpp_debug =~ s/\.ui/_d.cpp/; + $cpp_optimized = $_; + $cpp_optimized =~ s/\.ui/_o.cpp/; + $cpp_release = $_; + $cpp_release =~ s/\.ui/_r.cpp/; + $h = $_; + $h =~ s/\.ui/.h/; + + # add the ui-generated files separately for debug, optimized, and release builds + $uiGeneratedSources_debug .= q@ + + + + + + + + + + + +@; + + $uiGeneratedSources_optimized .= q@ + + + + + + + + + + + +@; + + $uiGeneratedSources_release .= q@ + + + + + + + + + + + +@; + + $uiGeneratedHeaders_debug .= q@ + + +@; + + $uiGeneratedHeaders_optimized .= q@ + + +@; + + $uiGeneratedHeaders_release .= q@ + + +@; + +} + +foreach (sort keys %templateNames) +{ + $_ = $templateNames{$_}; + $templates .= "\t\t\t\n" . $settings{$_} . "\t\t\t\n"; +} + +# ===================================================================== +# set up the replacements + +# setup the replacement strings +$replace{"%%guid%%"} = $guid; +$replace{"%%project%%"} = $project; +$replace{"%%Project%%"} = $Project; +$replace{"%%sources%%"} = $sources; +$replace{"%%headers%%"} = $headers; +$replace{"%%resource%%"} = $template_resource; +$replace{"%%resources%%"} = $resources; +$replace{"%%template%%"} = $template_template; +$replace{"%%templates%%"} = $templates; + +$replace{"%%debugInline%%"} = $debugInline; +$replace{"%%dbgInfo_r%%"} = $dbgInfo_r; +$replace{"%%dbgInfo_o%%"} = $dbgInfo_o; +$replace{"%%dbgInfo_d%%"} = $dbgInfo_d; +$replace{"%%incremental_r%%"} = $incremental_r; +$replace{"%%incremental_o%%"} = $incremental_o; +$replace{"%%incremental_d%%"} = $incremental_d; +$replace{"%%minimalRebuild%%"} = $minimalRebuild; +$replace{"%%opt_optimizationLevel%%"} = $opt_optimizationLevel; +$replace{"%%opt_intrinsicFunctions%%"} = $opt_intrinsicFunctions; +$replace{"%%opt_sizeOrSpeed%%"} = $opt_sizeOrSpeed; + +$replace{"%%includeDirectories_debug%%"} = explode(",", @includeDirectories_debug); +$replace{"%%includeDirectories_optimized%%"} = explode(",", @includeDirectories_optimized); +$replace{"%%includeDirectories_release%%"} = explode(",", @includeDirectories_release); +$replace{"%%defines_debug%%"} = explode(";", @defines_debug); +$replace{"%%defines_optimized%%"} = explode(";", @defines_optimized); +$replace{"%%defines_release%%"} = explode(";", @defines_release); +$replace{"%%libraries_debug%%"} = explode(" ", @libraries_debug); +$replace{"%%libraries_optimized%%"} = explode(" ", @libraries_optimized); +$replace{"%%libraries_release%%"} = explode(" ", @libraries_release); +$replace{"%%libraryDirectories_debug%%"} = explode(",", @libraryDirectories_debug); +$replace{"%%libraryDirectories_optimized%%"} = explode(",", @libraryDirectories_optimized); +$replace{"%%libraryDirectories_release%%"} = explode(",", @libraryDirectories_release); +$replace{"%%ignoreLibraries_debug%%"} = explode(",", @ignoreLibraries_debug); +$replace{"%%ignoreLibraries_optimized%%"} = explode(",", @ignoreLibraries_optimized); +$replace{"%%ignoreLibraries_release%%"} = explode(",", @ignoreLibraries_release); + +$replace{"%%uis%%"} = $uis; +$replace{"%%uiGeneratedSources_debug%%"} = $uiGeneratedSources_debug; +$replace{"%%uiGeneratedHeaders_debug%%"} = $uiGeneratedHeaders_debug; +$replace{"%%uiGeneratedSources_optimized%%"} = $uiGeneratedSources_optimized; +$replace{"%%uiGeneratedHeaders_optimized%%"} = $uiGeneratedHeaders_optimized; +$replace{"%%uiGeneratedSources_release%%"} = $uiGeneratedSources_release; +$replace{"%%uiGeneratedHeaders_release%%"} = $uiGeneratedHeaders_release; + +$replace{"%%qt_version%%"} = $qt_version; + +$replace{"%%usepch%%"} = "3"; + +if ($stdafx) +{ + $replace{"%%pch%%"} = "StdAfx.h"; +} +else +{ + if ($noPch) + { + $replace{"%%usepch%%"} = "0"; + $replace{"%%pch%%"} = ""; + } + elsif ($noPchDir) + { + $replace{"%%pch%%"} = "First" . $Project . ".h"; + } + else + { + $replace{"%%pch%%"} = $project . "\\First" . $Project . ".h"; + } +} + +# ===================================================================== + +# do all the replacements repeatedly until no more replacements can be made +do +{ + $changed = 0; + foreach $key (keys %replace) + { + $changed += $output =~ s/$key/$replace{$key}/; + } +} while ($changed > 0); + +# remove all blank lines +$output =~ s/^\n+//; +$output =~ s/\n\n+/\n/g; + +# convert newlines to cr/lf sequences +$output =~ s/\n/\cM\cJ/g; + +# save the output +open(DSP, ">" . $project . ".vcproj") || die "could not open project file " . $project . ".vcproj for writing\n"; +binmode(DSP); +print DSP $output; +close(DSP); + +# ===================================================================== + +BEGIN +{ + +sub process_rsp +{ + local $_; + my @rsp; + while (@_) + { + open(RSP, shift @_); + while () + { + chomp; + + # handle comments + s/#.*//; + + s/\s+$//; + tr/\//\\/; + push(@rsp, $_) if ($_ ne ""); + } + close(RSP); + } + return @rsp; +} + +sub explode +{ + local $_; + my $separator = shift @_; + my $result = shift @_; + + foreach (@_) + { + $result .= $separator . $_; + } + + return $result; +} + +# --------------------------------------------------------------------- + +$template_windows = q@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +%%sources%% + + +%%headers%% + +%%template%% +%%resource%% + + + + +@; + +$template_mfc = q@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +%%sources%% + + +%%headers%% + +%%template%% +%%resource%% + + + + +@; + +$template_qt= q@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +%%sources%% + + +%%headers%% + + +%%uis%% + + + + +%%uiGeneratedSources_debug%% + + +%%uiGeneratedHeaders_debug%% + + + + +%%uiGeneratedSources_optimized%% + + +%%uiGeneratedHeaders_optimized%% + + + + +%%uiGeneratedSources_release%% + + +%%uiGeneratedHeaders_release%% + + + +%%resource%% +%%template%% + + + + +@; + +$template_console = q@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +%%sources%% + + +%%headers%% + +%%template%% + + + + +@; + +$template_library = q@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +%%sources%% + + +%%headers%% + +%%template%% + + + + +@; + +$template_utility = q@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +%%sources%% + + +%%headers%% + +%%template%% +%%resource%% + + + + +@; + + $template_resource = q@ + +%%resources%% + +@; + + $template_template = q@ + +%%templates%% + +@; + + $mocHeader = q@ + + + + + + + + + +@; + + $excludeFromBuild = q@ + + + + + + + + + +@; + + $createPrecompiledHeader = q@ + + + + + + + + + +@; + +# --------------------------------------------------------------------- + +} diff --git a/gameserver/utils/tools/CheckPatchTreeSize.pl b/gameserver/utils/tools/CheckPatchTreeSize.pl new file mode 100755 index 0000000..9e1441a --- /dev/null +++ b/gameserver/utils/tools/CheckPatchTreeSize.pl @@ -0,0 +1,240 @@ +#! /usr/bin/perl +# ====================================================================== +# ====================================================================== + +use strict; +use warnings; +use File::Copy; + +# ====================================================================== +# Globals +# ====================================================================== + +my $oldManifest = "dailyPatchSizeOld.mft"; +my $newManifest = "dailyPatchSizeNew.mft"; +my $tabFile = "CheckPatchTreeSize.tab"; +my $numberOfTabOuts = 15; +my $p4 = "p4"; + +my $branch; +my $changelist; +my $toolsDir; +my %patchTreeSizes; + +my $name = $0; +$name =~ s/^(.*)\\//; +my $logfile = $name; +$logfile =~ s/\.pl$/\.log/; + +# ====================================================================== +# Subroutines +# ====================================================================== + +sub getP4dir +{ + my $path = $_[0]; + + open(P4, "p4 where ${path}... |"); + my $perforceDir; + while() + { + $perforceDir = $_; + } + my @temp = split /\s+/, $perforceDir; + my $retDir = $temp[2]; + close(P4); + + $retDir =~ s/\.\.\.//g; + + return $retDir; +} + +sub usage +{ + die "\n\t$name []\n\n"; +} + +sub readMft +{ + my ($filename, $hashRef) = @_; + + return if (!-e $filename); + + open(MFT, $filename); + + my $version = ; + chomp $version; + $version =~ s/ .*//; + die "unsupported manifest version" if ($version ne "version2"); + + while() + { + my ($archive, $action, $uncsize, $cmpsize, $checksum, $depotfile, $file) = /^(\S+)\t\S+\t(\S+)\t\S+\t(\S+)\t(\S+)\t(\S+)\t(\S+)\#\d+\t(\S+)\n$/; + next if(!defined $file); + $$hashRef{$depotfile} = [$checksum, $file, $archive, $action, $uncsize, $cmpsize]; + } + close(MFT); +} + +sub doSync +{ + my $oldchangelist = -1; + + open(TABFILE, $tabFile) || goto NOTABFILE; + while() + { + $oldchangelist = $1 if(/(\d+)\n/); + } + close(TABFILE); + +NOTABFILE: + + if($oldchangelist == -1) + { + system("$p4 sync //depot/swg/$branch/data/...\@$changelist //depot/swg/$branch/exe/win32/...\@$changelist > $logfile 2>&1"); + } + else + { + system("$p4 sync //depot/swg/$branch/data/...\@$oldchangelist,$changelist //depot/swg/$branch/exe/win32/...\@$changelist > $logfile 2>&1"); + } +} + +sub doExcelOut +{ + my @tabOuts; + + print "\nTab delimeted output for $branch:\n"; + + my @skus = (sort keys %patchTreeSizes); + print "Time\t"; + foreach (@skus) + { + print "sku.$_\t"; + } + print "Changelist\n"; + + if (-e $tabFile) + { + open(TABFILE, $tabFile); + while() + { + push @tabOuts, $_; + } + close(TABFILE); + } + + while(@tabOuts > $numberOfTabOuts) + { + shift @tabOuts; + } + + foreach (@tabOuts) + { + print; + } + + my ($sec, $min, $hr, $day, $mon, $yr) = localtime time; + my $timestamp = sprintf "%4s-%02s-%02s %02s:%02s:%02s", ($yr + 1900), ($mon + 1), $day, $hr, $min, $sec; + + my $output = "$timestamp\t"; + foreach (@skus) + { + if(exists $patchTreeSizes{$_}) + { + $output .= "$patchTreeSizes{$_}\t"; + } + else + { + $output .= "0\t"; + } + } + $output .= "$changelist\n"; + + print $output; + open(TABFILE, ">>$tabFile"); + print TABFILE $output; + close(TABFILE); +} + +sub doChanges +{ + my %oldMft; + my %newMft; + my @output; + + # Read in the mft file information + readMft($oldManifest, \%oldMft); + readMft($newManifest, \%newMft); + + # Check for differences + foreach (keys %newMft) + { + # Only update output if the file is new, or the checksum has changed + next if(exists $oldMft{$_} && $newMft{$_}->[0] eq $oldMft{$_}->[0]); + + my $uncDiff = $newMft{$_}->[4] - ((exists $oldMft{$_}) ? $oldMft{$_}->[4] : 0); + my $cmpDiff = $newMft{$_}->[5] - ((exists $oldMft{$_}) ? $oldMft{$_}->[5] : 0); + push @output, join("\t", $_, $newMft{$_}->[1], $newMft{$_}->[2], $newMft{$_}->[3], $uncDiff, $cmpDiff); + } + + print "\nFiles changed for $branch:\n"; + print join("\t", "Depot Name", "File Name", "Archive", "Action", "Size Added (Uncompressed)", "Size Added (Compressed)"), "\n"; + @output = sort { $a cmp $b } @output; + print join "\n", @output; +} + +# ====================================================================== +# Main +# ====================================================================== + +usage() if(@ARGV < 2); + +my $inputManifest = shift; +$branch = shift; + +$changelist = `p4 counter change`; +chomp $changelist; +$changelist = shift if (@ARGV); + +$toolsDir = getP4dir("//depot/swg/current/tools/"); +my $buildClientDataTreeFiles = getP4dir("//depot/swg/all/tools/build/shared/buildClientDataTreeFiles.pl"); + +my $exeDir = getP4dir("//depot/swg/$branch/exe/win32/"); +chdir $exeDir or die "Could not change directory: $!"; +my $pwd = `pwd`; +chomp $pwd; +$ENV{"PWD"} = $pwd; + +doSync(); + +system("perl $buildClientDataTreeFiles --noVerify $newManifest $inputManifest 0 > $logfile"); + +die "Error creating patch tree - patch_0_00.tre does not exist\n" if(!-e "patch_0_00.tre"); + +opendir DH, $exeDir; +foreach (sort readdir DH) +{ + if(/patch_sku([^_]+)_0_(\d+)\.tre/) + { + $patchTreeSizes{$1} = 0 if (!exists $patchTreeSizes{$1}); + $patchTreeSizes{$1} += (-s $_); + } + elsif (/patch_0_(\d+)\.tre/) + { + $patchTreeSizes{0} = 0 if (!exists $patchTreeSizes{0}); + $patchTreeSizes{0} += (-s $_); + } +} +closedir DH; + +print "Patch tree sizes for $branch:\n"; + +foreach (sort keys %patchTreeSizes) +{ + print "Size of sku$_.tre is: ".$patchTreeSizes{$_}."\n"; +} + +doExcelOut(); +doChanges() if(-e $oldManifest); + +move $newManifest, $oldManifest || die "move from $newManifest to $oldManifest failed"; diff --git a/gameserver/utils/tools/ContentSync.pl b/gameserver/utils/tools/ContentSync.pl new file mode 100755 index 0000000..9351fea --- /dev/null +++ b/gameserver/utils/tools/ContentSync.pl @@ -0,0 +1,195 @@ +#! /usr/bin/perl +# +# Fix for Malformed UTF-8 Character error in perl 5.8.0 on linux - "export LANG=en_US" + +use warnings; +use strict; + +# ====================================================================== +# initialization + +# setup perforce access environment variables +my $p4 = "p4"; + +my $branch = ""; +my $startingChangelist = 0; +my $endingChangelist; +my $contentLevel = 2; + +my $name = $0; +$name =~ s/^(.*)\\//; + +my $logfile = $name; +$logfile =~ s/\.pl$/\.log/; + +my $programmer = 0; +my $designer = 1; +my $artist = 2; +my $default = $programmer; +my %content; + +# ====================================================================== + +sub usage +{ + print STDERR "\nUsage:\n"; + print STDERR "\t$name \n"; + print STDERR "\n\tending changelist can be a changelist or #head\n"; + die "\n"; +} + +sub getUsers +{ + my ($group, $value) = @_; + my $foundUsers = 0; + + open(P4, "$p4 group -o $group |"); + while() + { + $foundUsers = 1 if(/^Users:/); + next if(!$foundUsers); + $content{$1} = $value if(/^\s+(\S+)/); + } + close(P4); +} + +# ====================================================================== + +&usage() if(@ARGV == 0); + +my $forceContentLevel; +if(@ARGV == 4) +{ + $forceContentLevel = shift @ARGV; +} + +&usage() if(@ARGV != 3); + +$branch = shift; +$startingChangelist = shift; +$endingChangelist = shift; + +my $user; + +print "Gathering list of users...\n"; +getUsers("swg_programmers", $programmer); +getUsers("swg_leads", $programmer); +getUsers("swg_qa", $programmer); +getUsers("swg_designers", $designer); +getUsers("swg_artists", $artist); + +if (defined $forceContentLevel) +{ + $contentLevel = $forceContentLevel; + $user = "ContentLevelOverride"; +} +else +{ + open(P4, "$p4 user -o |") || die "p4 user failed\n"; + while() + { + if(/^User:\s+(\S+)/) + { + $user = $1; + die "Could not determine if $user is a programmer, designer, or artist\n" if(!exists $content{$user}); + + $contentLevel = $content{$user}; + } + } + close(P4); +} + +my $level; +die "Unknown contentLevel: $contentLevel\n" if($contentLevel < 0); +$level = "programmer" if($contentLevel == 0); +$level = "designer" if($contentLevel == 1); +$level = "artist" if($contentLevel == 2); +$level = "specified content only" if($contentLevel >= 3); + +print STDERR "Syncing for $user at content level of $level\n"; + +print STDERR "Getting changes from $startingChangelist to $endingChangelist...\n"; +my @changes; +open(P4, "$p4 changes -s submitted //depot/swg/$branch/...\@$startingChangelist,$endingChangelist |") || die "p4 changes failed\n"; +while () +{ + chomp; + s/^Change //; + s/ .*//; + unshift @changes, $_; +} +close(P4); + +print STDERR "Scanning changes...\n"; +# process all the changelists looking for content files +my %sync; +foreach my $changeList (@changes) +{ + # read the change description + my $content = 0; + my $user; + my $notes = ""; + my $file; + open(P4, "$p4 -ztag describe -s $changeList |") || die "die: p4 change failed"; + + while () + { + # make the initial decision based on the user + if (/^\.\.\.\s+user\s+(.*)/) + { + $user = $1; + if (!defined $content{$user}) + { + # If we don't have the user listed, use default + $content = $default >= $contentLevel ? 1 : 0; + print STDERR "could not determine content status of $1 for changelist $changeList\n"; + } + else + { + $content = $content{$user} >= $contentLevel ? 1 : 0; + } + } + + # allow overrides in the descriptions + if (/\[\s*no\s+content\s*\]/i) + { + $content = 0; + $notes = " specified [no content]"; + } + if (/\[\s*content\s*\]/i) + { + $content = 1; + $notes = " specified [content]"; + } + + # remember content files + if ($content) + { + $file = $1 if (/^\.\.\.\s+depotFile\d+\s+(.*)/); + $sync{$file} = $1 if (/^\.\.\.\s+rev\d+\s+(.*)/); + } + } + + # give summary of this changelist + print "no " if (!$content); + print "content $changeList $user$notes\n"; + + close(P4); +} + +if (scalar(keys %sync) != 0) +{ + print STDERR "\nUpdating the client with ", scalar(keys %sync), " file(s)...\n"; + open(P4, "| $p4 -x - sync > $logfile 2>&1"); + foreach (sort keys %sync) + { + print P4 $_, "#", $sync{$_}, "\n"; + } + close(P4); +} +else +{ + print STDERR "No files to update.\n"; +} + +#unlink($logfile); diff --git a/gameserver/utils/tools/MoneyCheckActivity.pl b/gameserver/utils/tools/MoneyCheckActivity.pl new file mode 100755 index 0000000..43e58f3 --- /dev/null +++ b/gameserver/utils/tools/MoneyCheckActivity.pl @@ -0,0 +1,363 @@ +#! /usr/bin/perl + +use strict; +use warnings; +use Getopt::Std; +use Math::BigInt; + +my %player_hash; + +# key (player id) => (# trans to, total amt to them, last time to them, +# # trans from, total amt from them, last time from them) +# money_hash is a global hash referece for whatever player we are analyzing +my $money_hash; + +my $cnt = 0; +my $sort_val = 0; +my $max_cnt = 0; +my %args; +my $start_time; +my $min_thresh = 0; +my $max_thresh = 0; +my $player_id = 0; +my $start_date; +my $end_date; +my $num_days; + +my $total_in = new Math::BigInt '0'; +my $total_out = new Math::BigInt '0'; +my $num_total_in = new Math::BigInt '0'; +my $num_total_out = new Math::BigInt '0'; +my @keys; + +my $big_zero = new Math::BigInt '0'; +my $str_out; + +my $abridged = 1; + +# Usage +sub usage +{ + my $name = $0; + $name =~ s/^(.*)\\//; + print STDERR "\nUsage:\n"; + print STDERR "\t$name ... (as many player ids as you want to scan)\n"; + print STDERR "\t\tDate format = yyyy-mm-dd (eg: 2004-06-08)\n"; + print STDERR "\t$name -f ... (as many player ids as you want to scan)\n"; + print STDERR "Optional parameters:\n"; + print STDERR "\t[-l ] [-s | -S ] [-n | -a | -t | -N | -A | -T] [-m | -x | -e ] [-d]\n"; + print STDERR "\t-l \tOnly process lines of log file\n"; + print STDERR "\t-s