* added compilers lcc and bcc (linux86)
[mascara-docs.git] / compilers / lcc / etc / .svn / text-base / bytecode.c.svn-base
blobfe4178fd8165782d61440137a5da621c864e0e74
1 /* quake3 bytecode target */
3 #include <string.h>
4 #include <stdio.h>
5 #include "../../../qcommon/q_platform.h"
7 #ifdef _WIN32
8 #define BINEXT ".exe"
9 #else
10 #define BINEXT ""
11 #endif
13 char *suffixes[] = { ".c", ".i", ".asm", ".o", ".out", 0 };
14 char inputs[256] = "";
15 char *cpp[] = { "q3cpp" BINEXT,
16         "-D__STDC__=1", "-D__STRICT_ANSI__", "-D__signed__=signed", "-DQ3_VM",
17         "$1", "$2", "$3", 0 };
18 char *include[] = { 0 };
19 char *com[] = { "q3rcc" BINEXT, "-target=bytecode", "$1", "$2", "$3", 0 };
20 char *ld[] = { 0 };
21 char *as[] = { 0 };
23 extern char *concat(char *, char *);
26 ===============
27 UpdatePaths
29 Updates the paths to q3cpp and q3rcc based on
30 the directory that contains q3lcc
31 ===============
33 void UpdatePaths( const char *lccBinary )
35         char basepath[ 1024 ];
36         char *p;
38         strncpy( basepath, lccBinary, 1024 );
39         p = strrchr( basepath, PATH_SEP );
41         if( p )
42         {
43                 *( p + 1 ) = '\0';
45                 cpp[ 0 ] = concat( basepath, "q3cpp" BINEXT );
46                 com[ 0 ] = concat( basepath, "q3rcc" BINEXT );
47         }
50 int option(char *arg) {
51         if (strncmp(arg, "-lccdir=", 8) == 0) {
52                 cpp[0] = concat(&arg[8], "/q3cpp" BINEXT);
53                 include[0] = concat("-I", concat(&arg[8], "/include"));
54                 com[0] = concat(&arg[8], "/q3rcc" BINEXT);
55         } else if (strcmp(arg, "-p") == 0 || strcmp(arg, "-pg") == 0) {
56                 fprintf( stderr, "no profiling supported, %s ignored.\n", arg);
57         } else if (strcmp(arg, "-b") == 0)
58                 ;
59         else if (strcmp(arg, "-g") == 0)
60                 fprintf( stderr, "no debugging supported, %s ignored.\n", arg);
61         else if (strncmp(arg, "-ld=", 4) == 0 || strcmp(arg, "-static") == 0) {
62                 fprintf( stderr, "no linking supported, %s ignored.\n", arg);
63         } else
64                 return 0;
65         return 1;