depend 657 B

12345678910111213141516171819202122232425262728
  1. # Figure out dependencies for lmbench src.
  2. #
  3. # Hacked into existence by Larry McVoy (lm@sun.com now lm@sgi.com).
  4. # Copyright (c) 1994 Larry McVoy. GPLed software.
  5. # $Id$
  6. eval 'exec perl -Ssw $0 "$@"'
  7. if 0;
  8. open(M, "Makefile");
  9. while(<M>) {
  10. push(@Makefile, $_);
  11. last if /^..MAKEDEPEND/;
  12. }
  13. close(M);
  14. open(G, "gcc -MM *.c | grep -v mhz.c | grep -v lat_ctx.c|");
  15. while (<G>) {
  16. chop;
  17. split(/:/);
  18. $_[0] =~ s/\.o\s*$//;
  19. push(@Makefile, "\$O/$_[0]: $_[1] \$O/lmbench.a\n");
  20. push(@Makefile, "\t\$(COMPILE) -o \$O/$_[0] $_[0].c \$O/lmbench.a \$(LDLIBS)\n\n");
  21. }
  22. system "mv Makefile Makefile.old";
  23. open(M, ">Makefile");
  24. print M @Makefile;
  25. close(M);
  26. exit 0;