win32.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* x86s running MS Windows NT 4.0 */
  2. #include <string.h>
  3. #ifndef LCCDIR
  4. // JDC #define LCCDIR "\\progra~1\\lcc\\4.1\\bin\\"
  5. //#define LCCDIR "\\quake3\\source\\lcc\\bin\\" // JDC
  6. // TTimo: q3cpp q3rcc & no hardcoded paths
  7. #define LCCDIR ""
  8. #endif
  9. char *suffixes[] = { ".c;.C", ".i;.I", ".asm;.ASM;.s;.S", ".obj;.OBJ", ".exe", 0 };
  10. char inputs[256] = "";
  11. char *cpp[] = { LCCDIR "q3cpp", "-D__STDC__=1", "-Dwin32", "-D_WIN32", "-D_M_IX86",
  12. "$1", "$2", "$3", 0 };
  13. char *include[] = { "-I" LCCDIR "include", 0 };
  14. char *com[] = { LCCDIR "q3rcc", "-target=x86/win32", "$1", "$2", "$3", 0 };
  15. char *as[] = { "ml", "-nologo", "-c", "-Cp", "-coff", "-Fo$3", "$1", "$2", 0 };
  16. char *ld[] = { "link", "-nologo",
  17. "-align:0x1000", "-subsystem:console", "-entry:mainCRTStartup",
  18. "$2", "-OUT:$3", "$1", LCCDIR "liblcc.lib", "libc.lib", "kernel32.lib", 0 };
  19. extern char *concat(char *, char *);
  20. extern char *replace(const char *, int, int);
  21. int option(char *arg) {
  22. if (strncmp(arg, "-lccdir=", 8) == 0) {
  23. arg = replace(arg + 8, '/', '\\');
  24. if (arg[strlen(arg)-1] == '\\')
  25. arg[strlen(arg)-1] = '\0';
  26. cpp[0] = concat(arg, "\\cpp.exe");
  27. include[0] = concat("-I", concat(arg, "\\include"));
  28. com[0] = concat(arg, "\\rcc.exe");
  29. ld[8] = concat(arg, "\\liblcc.lib");
  30. } else if (strcmp(arg, "-b") == 0)
  31. ;
  32. else if (strncmp(arg, "-ld=", 4) == 0)
  33. ld[0] = &arg[4];
  34. else
  35. return 0;
  36. return 1;
  37. }