</$objtype/mkfile

HFILES=\
      HsFFI.h \
      HugsAPI.h \
      builtin.h \
      char.h \
      command.h \
      config.h \
      connect.h \
      errors.h \
      evaluator.h \
      goal.h \
      machdep.h \
      module.h \
      observe.h \
      options.h \
      opts.h \
      output.h \
      platform.h \
      prelude.h \
      script.h \
      server.h \
      storage.h \
      strutil.h \
      subst.h \
      
OFILES=\
      machdep.$O \
      builtin.$O \
      char.$O \
      compiler.$O \
      edit.$O \
      errors.$O \
      evaluator.$O \
      goal.$O \
      input.$O \
      machine.$O \
      module.$O \
      opts.$O \
      output.$O \
      plugin.$O \
      script.$O \
      static.$O \
      storage.$O \
      strutil.$O \
      subst.$O \
      version.$O \
      type.$O \
      
TARG=hugs runhugs
BIN=$home/bin/$objtype/haskell

UPDATE=\
	mkfile\
	$CFILES\
	$HFILES\
	${TARG:%=/386/haskell/%}


</sys/src/cmd/mkmany


default:V: all

HUGSDIR=$home/lib/haskell
CC=pcc
CFLAGS=-pc -D_BSD_EXTENSION -ND_POSIX_SOURCE \
       -DMONTH_YEAR -DHUGSDIR="$HUGSDIR" \
         
%.$O: %.c
	$CC $CFLAGS $stem.c

$O.hugs: $OFILES hugs.$O observe.$O
    $LD -o $target $prereq

$O.runhugs: $OFILES runhugs.$O server.$O
    $LD -o $target $prereq
install:V: $BIN

$BIN:V:
    mkdir -p $BIN
          
installlib:V:
	mkdir -p $HUGSDIR
	mkdir -p $HUGSDIR/lib
	dircp ../hugslib/ $HUGSDIR/lib/
	
uninstall:V:
	rm -rf $HUGSDIR
	rm -rf $BIN
	
