FreeCalypso > hg > fc-magnetite
annotate helpers/makeline.c @ 685:3fb7384e820d
tpudrv12.h: FCDEV3B goes back to being itself
A while back we had the idea of a FreeCalypso modem family whereby our
current fcdev3b target would some day morph into fcmodem, with multiple
FC modem family products, potentially either triband or quadband, being
firmware-compatible with each other and with our original FCDEV3B. But
in light of the discovery of Tango modules that earlier idea is now being
withdrawn: instead the already existing Tango hw is being adopted into
our FreeCalypso family.
Tango cannot be firmware-compatible with triband OM/FCDEV3B targets
because the original quadband RFFE on Tango modules is wired in TI's
original Leonardo arrangement. Because this Leonardo/Tango way is now
becoming the official FreeCalypso way of driving quadband RFFEs thanks
to the adoption of Tango into our FC family, our earlier idea of
extending FIC's triband RFFE control signals with TSPACT5 no longer makes
much sense - we will probably never produce any new hardware with that
once-proposed arrangement. Therefore, that triband-or-quadband FCFAM
provision is being removed from the code base, and FCDEV3B goes back to
being treated the same way as CONFIG_TARGET_GTAMODEM for RFFE control
purposes.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 24 Sep 2020 21:03:08 +0000 |
parents | 352f80da6813 |
children |
rev | line source |
---|---|
9
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This helper utility for the FreeCalypso Magnetite build system |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * emits potentially long generated Makefile lines, breaking them into |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * multiple lines with backslashes. |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 */ |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <stdio.h> |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <stdlib.h> |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <string.h> |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include <strings.h> |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 int is_cmd, equ_or_colon, extra_indent; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 int linelen; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 main(argc, argv) |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 char **argv; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 { |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 char **ap; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 if (argc < 4) { |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 fprintf(stderr, "error: too few arguments\n", argv[0]); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 exit(1); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 } |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 if (!strcmp(argv[1], "def")) { |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 is_cmd = 0; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 equ_or_colon = '='; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 extra_indent = 0; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 } else if (!strcmp(argv[1], "dep")) { |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 is_cmd = 0; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 equ_or_colon = ':'; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 extra_indent = 1; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 } else if (!strcmp(argv[1], "cmd")) { |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 is_cmd = 1; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 extra_indent = 1; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 } else { |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 fprintf(stderr, "error: line type \"%s\" not known\n", argv[1]); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 exit(1); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 } |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 if (is_cmd) { |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 putchar('\t'); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 linelen = 8; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 } else |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 linelen = 0; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 fputs(argv[2], stdout); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 linelen += strlen(argv[2]); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 if (is_cmd) { |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 putchar(' '); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 linelen++; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 } else { |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 putchar(equ_or_colon); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 linelen++; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 putchar('\t'); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 do |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 linelen++; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 while (linelen & 7); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 } |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 fputs(argv[3], stdout); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 linelen += strlen(argv[3]); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 for (ap = argv + 4; *ap; ap++) { |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 if (linelen + 1 + strlen(*ap) <= 78) { |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 putchar(' '); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 linelen++; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 } else { |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 fputs(" \\\n\t", stdout); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 linelen = 8; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 if (extra_indent) { |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 fputs(" ", stdout); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 linelen += 4; |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 } |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 } |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 fputs(*ap, stdout); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 linelen += strlen(*ap); |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 } |
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 putchar('\n'); |
10 | 75 exit(0); |
9
05945a9b9dda
makeline helper written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 } |