mridge | 1c5ac21 | 2006-01-26 22:16:41 +0000 | [diff] [blame] | 1 | # Quickie makefile to (sort of) automate various pounder tasks. |
| 2 | |
| 3 | # Copyright (C) 2003-2006 IBM |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 4 | # |
mridge | 1c5ac21 | 2006-01-26 22:16:41 +0000 | [diff] [blame] | 5 | # This program is free software; you can redistribute it and/or |
| 6 | # modify it under the terms of the GNU General Public License as |
| 7 | # published by the Free Software Foundation; either version 2 of the |
| 8 | # License, or (at your option) any later version. |
| 9 | # |
| 10 | # This program is distributed in the hope that it will be useful, but |
| 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | # General Public License for more details. |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 14 | # |
mridge | 1c5ac21 | 2006-01-26 22:16:41 +0000 | [diff] [blame] | 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with this program; if not, write to the Free Software |
| 17 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 18 | # 02111-1307, USA. |
| 19 | |
| 20 | # Quickie makefile to do pounder stuff. |
mridge | 5b8e465 | 2006-02-01 20:47:43 +0000 | [diff] [blame] | 21 | NAME=ltpounder |
mridge | 1c5ac21 | 2006-01-26 22:16:41 +0000 | [diff] [blame] | 22 | CFLAGS=-O3 -Wall -g |
mridge | 1c5ac21 | 2006-01-26 22:16:41 +0000 | [diff] [blame] | 23 | HELPERS=timed_loop infinite_loop run-helper fancy_timed_loop |
| 24 | |
| 25 | install:; |
| 26 | ./Install |
| 27 | |
| 28 | helpers: $(HELPERS) |
| 29 | |
| 30 | fancy_timed_loop: fancy_timed_loop.c debug.o |
| 31 | $(CC) $(CFLAGS) -o fancy_timed_loop fancy_timed_loop.c debug.o |
| 32 | |
| 33 | timed_loop: timed_loop.c debug.o |
| 34 | $(CC) $(CFLAGS) -o timed_loop timed_loop.c debug.o |
| 35 | |
| 36 | infinite_loop: infinite_loop.c debug.o |
| 37 | $(CC) $(CFLAGS) -o infinite_loop infinite_loop.c debug.o |
| 38 | |
| 39 | run-helper: run.c debug.o proclist.o |
| 40 | $(CC) $(CFLAGS) -o run-helper run.c debug.o proclist.o |
| 41 | |
| 42 | srctar:; |
mridge | 5b8e465 | 2006-02-01 20:47:43 +0000 | [diff] [blame] | 43 | cd ../../../; make clean; tar -cvzf $(NAME)-`date '+%Y-%m-%d'`.src.tar.gz --exclude '*CVS*' $(NAME) |
mridge | 1c5ac21 | 2006-01-26 22:16:41 +0000 | [diff] [blame] | 44 | |
| 45 | bintar:; |
| 46 | echo "Making binary tarball for" `uname -m` "platform." |
| 47 | ./Install |
mridge | 5b8e465 | 2006-02-01 20:47:43 +0000 | [diff] [blame] | 48 | cd ../../../; tar -czf $(NAME)-`date '+%Y-%m-%d'`.`uname -m`.tar.gz $(NAME) --exclude='*CVS*' |
mridge | 1c5ac21 | 2006-01-26 22:16:41 +0000 | [diff] [blame] | 49 | |
| 50 | helpers_clean:; |
| 51 | rm -rf $(HELPERS) *.o |
| 52 | |
| 53 | # Clean out all cruft from a pounder run |
| 54 | clean: helpers_clean |
mridge | 5b8e465 | 2006-02-01 20:47:43 +0000 | [diff] [blame] | 55 | ./pounder -u |
mridge | 1c5ac21 | 2006-01-26 22:16:41 +0000 | [diff] [blame] | 56 | if [ -d opt ]; then cd opt; for i in *; do if [ -d $$i ]; then cd $$i; make clean; cd -; fi; done; fi; |
| 57 | cd src; for i in *; do if [ -d $$i ]; then cd $$i; make clean; cd -; fi; done; |
| 58 | rm -rf tmp pounder.pid |
| 59 | |
| 60 | # Put everything back as it was when this tarball was unpacked. |
| 61 | mrclean: helpers_clean; |
mridge | 5b8e465 | 2006-02-01 20:47:43 +0000 | [diff] [blame] | 62 | ./pounder -u |
mridge | 1c5ac21 | 2006-01-26 22:16:41 +0000 | [diff] [blame] | 63 | rm -rf opt log run-helper infinite_loop timed_loop debug.o tmp proclist.o |
| 64 | find src/ -name Makefile | while read f; do cd `dirname $$f`; $(MAKE) clean; cd -; done; |
| 65 | rm -rf `find tests/* 2>/dev/null | grep -v CVS` |
| 66 | rm -rf pounder.pid |
| 67 | |
| 68 | distclean: mrclean; |
| 69 | |
| 70 | |
| 71 | testtar:; |
| 72 | tar -cvzf default-tests.tar.gz tests/D* tests/T* |