/* Copyright (c) 2002-2012 Croteam Ltd. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "StdH.h" #include "Dependency.h" // Depend - extract dependencies and create group file utility #define ACHR_OPTION argv[1] #define ACHR_APP_DIR argv[2] void PrintUsage() { printf( "\nUSAGE:\n" "Depend d \n" " make difference beetween two dependency files (result = file 1 - file 2)\n" "Depend i \n" " create dependencies for files listed in given list file\n" "Depend u \n" " remove updated files from dependency file\n" "Depend e \n" " export dependency file to ascii list file\n" "Depend t \n" " export strings for translation\n" "\n"); exit( EXIT_FAILURE); } void SubMain( int argc, char *argv[]); int main( int argc, char *argv[]) { CTSTREAM_BEGIN { SubMain(argc, argv); } CTSTREAM_END; return 0; } void SubMain( int argc, char *argv[]) { // there must be 4 or 6 parameters (first is depend.exe file name) if( (argc < 4) || (argc > 6) ) { PrintUsage(); } // initialize engine SE_InitEngine(argv[0], ""); // get application path from cmd line _fnmApplicationPath = CTString(ACHR_APP_DIR); // if not ending with backslash if (_fnmApplicationPath[strlen(_fnmApplicationPath)-1]!='\\') { _fnmApplicationPath += "\\"; } // get all filenames from command line CTFileName afnFiles[3]; INDEX ctFiles = argc-3; if (ctFiles>ARRAYCOUNT(afnFiles)) { PrintUsage(); } for (INDEX iFile=0; iFile