patch-makefile 942 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --- makefile.orig Sun Oct 29 17:03:34 2006
  2. +++ makefile Sun Oct 29 17:11:52 2006
  3. @@ -1,29 +1,38 @@
  4. YFLAGS = -d
  5. -CFLAGS = -g
  6. +#CFLAGS = -g
  7. SRC = hoc.y hoc.h code.c init.c math.c symbol.c
  8. OBJS = hoc.o code.o init.o math.o symbol.o
  9. hoc: $(OBJS)
  10. - $(CC) $(CFLAGS) $(OBJS) -lstdio -lm -o hoc
  11. + $(CC) $(CFLAGS) $(OBJS) -lm -o hoc
  12. hoc.o code.o init.o symbol.o: hoc.h
  13. code.o init.o symbol.o: x.tab.h
  14. +.if ${MACHINE_ARCH} == "i386"
  15. +code.o: code.c
  16. + $(CC) $(CFLAGS) -O0 -c code.c
  17. +.endif
  18. +
  19. x.tab.h: y.tab.h
  20. -cmp -s x.tab.h y.tab.h || cp y.tab.h x.tab.h
  21. -pr: $(SRC)
  22. - @prcan $?
  23. - @touch pr
  24. -
  25. install: hoc
  26. cp hoc /usr/bin
  27. strip /usr/bin/hoc
  28. +y.tab.h y.tab.c: hoc.y
  29. + yacc ${YFLAGS} hoc.y
  30. +
  31. clean:
  32. rm -f $(OBJS) [xy].tab.[ch] hoc
  33. bundle:
  34. @bundle $(SRC) makefile README
  35. +
  36. +# a few basic tests
  37. +regress:
  38. + echo 2/3 | hoc | grep '^0.66666666*7$$' >/dev/null
  39. + echo 'x=22/7\nprint x' | hoc | grep '^3.142857' >/dev/null