2 *------------------------------------------------------------------
3 * Copyright (c) 1997-2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 int main (int argc, char **argv)
36 printf ("usage: mkversion ostype version outputfile\n");
40 ofp = fopen (argv[3], "w");
42 printf ("Couldn't create %s\n", argv[3]);
48 fprintf (ofp, "/*\n");
49 fprintf (ofp, " * G2 Version Stamp, %s",
51 fprintf (ofp, " * Automatically generated, hand edits are pointless.\n");
52 fprintf (ofp, " */\n\n");
55 "const char *version_string = \"G2 (%s) major version %s\";\n",
58 username = (char *) cuserid (0);
60 strncpy(timestr, ctime(&now), sizeof (timestr));
71 "const char *minor_v_string = \"Built by %s at %s\";\n",