scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

0015-pflag.sh (967B)


      1 #!/bin/sh
      2 
      3 trap 'rm -f $tmp1 $tmp2' EXIT INT QUIT HUP TERM
      4 
      5 tmp1=tmp1.$$
      6 tmp2=tmp2.$$
      7 
      8 unset MAKEFLAGS
      9 
     10 (cat > $tmp2) <<'EOF'
     11 FC = fort77
     12 YFLAGS = 
     13 MAKE = scc-make
     14 ARFLAGS = -rv
     15 LDFLAGS = 
     16 LEX = lex
     17 CFLAGS = -O
     18 YACC = yacc
     19 CC = c99
     20 LFLAGS = 
     21 AR = ar
     22 SHELL = /bin/sh
     23 FFLAGS = -O 1
     24 .f.a:
     25 	${FC} -c ${FFLAGS} $<
     26 	${AR} ${ARFLAGS} $@ $*.o
     27 	rm -f $*.o
     28 
     29 .l.o:
     30 	${LEX} ${LFLAGS} $<
     31 	${CC} ${CFLAGS} -c lex.yy.c
     32 	rm -f lex.yy.c
     33 	mv lex.yy.o $@
     34 
     35 .c.a:
     36 	${CC} -c ${CFLAGS} $<
     37 	${AR} ${ARFLAGS} $@ $*.o
     38 	rm -f $*.o
     39 
     40 .c:
     41 	${CC} ${CFLAGS} ${LDFLAGS} -o $@ $<
     42 
     43 .c.o:
     44 	${CC} ${CFLAGS} -c $<
     45 
     46 .l.c:
     47 	${LEX} ${LFLAGS} $<
     48 	mv lex.yy.c $@
     49 
     50 .f.o:
     51 	${FC} ${FFLAGS} -c $<
     52 
     53 .f:
     54 	${FC} ${FFLAGS} ${LDFLAGS} -o $@ $<
     55 
     56 .y.o:
     57 	${YACC} ${YFLAGS} $<
     58 	${CC} ${CFLAGS} -c y.tab.c
     59 	rm -f y.tab.c
     60 	mv y.tab.o $@
     61 
     62 .y.c:
     63 	${YACC} ${YFLAGS} $<
     64 	mv y.tab.c $@
     65 
     66 .SUFFIXES: .o .c .y .l .a .sh .f
     67 
     68 all:
     69 
     70 .sh:
     71 	cp $< $@
     72 	chmod a+x $@
     73 
     74 EOF
     75 
     76 (scc-make -pf - > $tmp1 2>&1) <<'EOF'
     77 all:
     78 EOF
     79 
     80 diff -u $tmp1 $tmp2