1 /*****************************************************************************/
5 /* Main program for the ar65 archiver */
9 /* (C) 1998-2009, Ullrich von Bassewitz */
10 /* Roemerstrasse 52 */
11 /* D-70794 Filderstadt */
12 /* EMail: uz@cc65.org */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
54 /*****************************************************************************/
56 /*****************************************************************************/
60 static void Usage (void)
61 /* Print usage information and exit */
63 printf ("Usage: %s <operation> lib file|module ...\n"
64 "Operation is one of:\n"
66 "\td\tDelete modules\n"
67 "\tl\tList library contents\n"
68 "\tx\tExtract modules\n"
69 "\tV\tPrint the archiver version\n",
76 int main (int argc, char* argv [])
77 /* Assembler main program */
81 /* Initialize the cmdline module */
82 InitCmdLine (&argc, &argv, "ar65");
84 /* We must have a file name */
89 /* Check the parameters */
91 while (I < ArgCount) {
93 /* Get the argument */
94 const char* Arg = ArgVec [I];
96 /* Check for an option */
97 if (strlen (Arg) != 1) {
103 AddObjFiles (ArgCount - I - 1, &ArgVec[I+1]);
107 DelObjFiles (ArgCount - I - 1, &ArgVec [I+1]);
111 ListObjFiles (ArgCount - I - 1, &ArgVec [I+1]);
119 ExtractObjFiles (ArgCount - I - 1, &ArgVec [I+1]);
124 "ar65 V%s - (C) Copyright 1998-2009 Ullrich von Bassewitz\n",
125 GetVersionAsString ());
129 fprintf (stderr, "Unknown option: %s\n", Arg);
138 /* Return an apropriate exit code */