-
Notifications
You must be signed in to change notification settings - Fork 0
/
mk.build
22 lines (16 loc) · 967 Bytes
/
mk.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
all:QV: $DEPS $TARG $LIB $BIN
TARG = `{ if test "$TARG" != ""; then echo $TARG; else echo "NOTARG"; fi }
BIN = `{ if test "$BIN" != ""; then echo $BIN; else echo "NOBIN"; fi }
LIB = `{ if test "$LIB" != ""; then echo $LIB; else echo "NOLIB"; fi }
`{ printf "# Auto-generated file by mk, do not edit\n\n" > .targs.mk }
`{ 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 }
`{ 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 }
<.targs.mk
<$mkbuild/mk.deps
%.o: %.c
echo CC $stem.o
$CC $CFLAGS $DEPS_CFLAGS $LOCAL_CFLAGS $CPPFLAGS -c $stem.c -o $stem.o
%.c: %.y
echo YACC $stem.y
$YACC $stem.y
mv -f y.tab.c $stem.c