mkbuild

mk based build system
git clone git://git.2f30.org/mkbuild
Log | Files | Refs | LICENSE

mk.build (967B)


      1 all:QV: $DEPS $TARG $LIB $BIN
      2 	
      3 TARG = `{ if test "$TARG" != ""; then echo $TARG; else echo "NOTARG"; fi }
      4 BIN = `{ if test "$BIN" != ""; then echo $BIN; else echo "NOBIN"; fi }
      5 LIB = `{ if test "$LIB" != ""; then echo $LIB; else echo "NOLIB"; fi }
      6 
      7 `{ printf "# Auto-generated file by mk, do not edit\n\n" > .targs.mk }
      8 `{ for i in $BIN; do tobj=$(echo $i|tr '.' '_'|tr '/' '_'); printf "$i: \$"$tobj"_OBJ\n\techo LD \$target\n\t\$LD \$prereq \$LDFLAGS \$DEPS_LDFLAGS \$LOCAL_LDFLAGS \$"$tobj"_LDFLAGS \$LOCAL_BIN_LDFLAGS -o \$target\n\n" ; done >> .targs.mk }
      9 `{ for i in $LIB; do tobj=$(echo $i|tr '.' '_'|tr '/' '_'); printf "$i: \$"$tobj"_OBJ\n\techo AR \$target\n\t\$AR -rv \$target \$prereq\n\techo RANLIB \$target\n\t\$RANLIB \$target\n\n" ; done >> .targs.mk }
     10 <.targs.mk
     11 
     12 <$mkbuild/mk.deps
     13 
     14 %.o: %.c
     15 	echo CC $stem.o
     16 	$CC $CFLAGS $DEPS_CFLAGS $LOCAL_CFLAGS $CPPFLAGS -c $stem.c -o $stem.o
     17 
     18 %.c: %.y
     19 	echo YACC $stem.y
     20 	$YACC $stem.y
     21 	mv -f y.tab.c $stem.c
     22