git @ Cat's Eye Technologies Maentwrog / a84728b
Improve Makefile. Clean up warnings in rdp.c. Chris Pressey 8 years ago
3 changed file(s) with 31 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
0 CC?=gcc
1 CFLAGS=-ansi -pedantic -O
0 # GNU Makefile for maentwrog.
21
32 PROGS=bin/maentw bin/caparse bin/rpn bin/rdp
3 CC?=gcc
4
5 WARNS= -W -Wall -Wstrict-prototypes -Wmissing-prototypes \
6 -Wpointer-arith -Wno-uninitialized -Wreturn-type -Wcast-qual \
7 -Wwrite-strings -Wswitch -Wcast-align -Wchar-subscripts \
8 -Winline -Wnested-externs -Wredundant-decls
9
10 ifdef ANSI
11 CFLAGS+= -ansi -pedantic
12 else
13 CFLAGS+= -std=c99 -D_POSIX_C_SOURCE=200112L
14 endif
15
16 CFLAGS+= ${WARNS} ${EXTRA_CFLAGS}
17
18 ifdef DEBUG
19 CFLAGS+= -g
20 endif
421
522 all: $(PROGS)
623
4040 int level5 (int result);
4141 int level6 (int result);
4242 int primitive (int result);
43
44 int isdelimeter (char);
45 void gettoken (void);
46 void putback (void);
47 void serror (int);
48 int arith (char, int, int);
49 int findvar (char *);
50 int getexp (int);
4351
4452 /*-------------------------------------------------------------------------*/
4553
7583 void
7684 gettoken ()
7785 {
78 char temp[T_LENGTH];
79
8086 strcpy (token, "");
8187 token[1] = (char) 0;
8288
180186 case '^':
181187 return (argument ^ operand); /* binary XOR */
182188 }
189 exit(1);
183190 }
184191
185192 int
263270 level5 (int result)
264271 {
265272 char op;
266 int hold = 0;
267273
268274 op = ' ';
269275 if ((toktype == T_DELIMITER) && ((token[0] == '+') || (token[0] == '-')))
311317 int
312318 main (int argc, char **argv)
313319 {
320 argc = argc;
314321 {
315322 int c;
316323 for (c = 0; c <= 25; c++)
135135 */
136136 void procstr(char *s)
137137 {
138 char *h=strdup(s);
138 char *h;
139139 char *g;
140 h = strdup(s);
140141 g = strtok(h, " ");
141142 while (g)
142143 {