Ignore:
Timestamp:
May 1, 2002, 5:58:37 AM (23 years ago)
Author:
bird
Message:

Support for other watcom target OSes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/common/kDef2Wat.cpp

    r8003 r8360  
    1 /* $Id: kDef2Wat.cpp,v 1.3 2002-02-24 02:47:23 bird Exp $
     1/* $Id: kDef2Wat.cpp,v 1.4 2002-05-01 03:58:36 bird Exp $
    22 *
    33 * Converter for IBM/MS linker definition files (.DEF) to Watcom linker directives and options.
     
    2020#include "kFileFormatBase.h"
    2121#include "kFileDef.h"
     22
     23#include <stdio.h>
     24#include <string.h>
    2225
    2326/*******************************************************************************
     
    4245    const char *pszOutput;
    4346    const char *pszAppend;
     47    const char *pszOS;
     48    int         enmOS;
    4449
    4550    /* check arguments */
    46     if (argc != 3 && argc != 4)
     51    if (argc != 4 && argc != 5)
    4752    {
    4853        syntax();
    4954        return -1;
    5055    }
    51     pszInput  = argv[1];
    52     pszOutput = argv[2];
    53     pszAppend = (argc == 4) ? argv[3] : NULL;
     56    pszOS     = argv[1];
     57    pszInput  = argv[2];
     58    pszOutput = argv[3];
     59    pszAppend = (argc == 5) ? argv[4] : NULL;
     60    if (!stricmp(pszOS, "os2"))
     61        enmOS = kFileDef::os2;
     62    else if (!stricmp(pszOS, "dos"))
     63        enmOS = kFileDef::dos;
     64    else if (!stricmp(pszOS, "win32"))
     65        enmOS = kFileDef::win32;
     66    else if (!stricmp(pszOS, "win16"))
     67        enmOS = kFileDef::win16;
     68    else if (!stricmp(pszOS, "nlm"))
     69        enmOS = kFileDef::nlm;
     70    else if (!stricmp(pszOS, "qnx"))
     71        enmOS = kFileDef::qnx;
     72    else if (!stricmp(pszOS, "elf"))
     73        enmOS = kFileDef::elf;
     74    else
     75    {
     76        printf("Invalid os string '%s'.\n", pszOS);
     77        syntax();
     78        return -1;
     79    }
    5480
    5581    /*
     
    6490            OutFile.end();
    6591
    66             def.makeWatcomLinkFileAddtion(&OutFile);
     92            def.makeWatcomLinkFileAddtion(&OutFile, enmOS);
    6793            if (pszAppend)
    6894            {
     
    103129{
    104130    kFile::StdOut.printf(
    105         "kDef2Wat v0.0.0 (untested)\n"
     131        "kDef2Wat v0.0.1\n"
    106132        "\n"
    107         "syntax: kDef2Wat.exe <def-file> <wlink-file> [extra-file]\n"
     133        "syntax: kDef2Wat.exe <os> <def-file> <wlink-file> [extra-file]\n"
    108134        "\n"
    109135        "Where:\n"
     136        "    <os>           Target os. os2, dos, win32, win16, nlm, qnx or elf.\n"
    110137        "    <def-file>     The .DEF file to convert.\n"
    111138        "    <wlink-file>   The WLINK directive and option file.\n"
     
    113140        "                   the wlink-file\n"
    114141        "\n"
    115         "Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)\n"
     142        "Copyright (c) 2000-2002 knut st. osmundsen (bird@anduin.net)\n"
    116143        );
    117144}
Note: See TracChangeset for help on using the changeset viewer.