view Makefile.parallel @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
parents 44b8263c91ea
children
line wrap: on
line source

# $HeadURL$
# $Date$
# $Author$
#
# experimental parallel GnuMakefile for DStress http://dstress.kuehne.cn/www/dstress.html
# Copyright (C) 2006, 2007 Thomas Kuehne
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#                                      

#
# config
#

date := date +"%a, %e %b %Y %T %z"
uname := uname -s -m -r

ifndef CAT
CAT := cat
endif

ifndef CC
CC := cc
endif

ifndef DMD
DMD := dmd
export DMD
endif

ifndef FIND
FIND := find
endif

ifndef RM
RM := rm -rf --
endif

find := find
find_filter := -type f | grep -v "\\(\\.svn\\)\\|\\(\\.exe$$\\)"

###############################################################################
###############################################################################
#
# nothing to customize below this line
#
###############################################################################
###############################################################################

ifndef NO_TORTURE
torture := torture-
else
torture :=
endif

dstress := ./dstress
crashRun := ./crashRun
logsuffix := .outlog

.PHONY:: all clean compile nocompile norun run tools version

all :: version compile nocompile run norun

% : %.c
	$(CC) $(CFLAGS) -DUSE_VALGRIND $< -o $@
	
tools :: $(dstress) $(crashRun)

version :
	@$(date)
	@$(uname)
	-@$(DMD) -v

#
# compile
#
compile : $(sort $(patsubst %,%.exe,$(shell $(find) compile $(find_filter))))

compile/%.exe : compile/% tools
	@$(dstress) $(torture)compile $< > obj/$(notdir $<)$(logsuffix)
	@$(CAT) obj/$(notdir $<)$(logsuffix)
	@$(RM) obj/$(basename $(notdir $<))*

#
# nocompile
# 
nocompile : $(sort $(patsubst %,%.exe,$(shell $(find) nocompile $(find_filter))))

nocompile/%.exe : nocompile/% tools
	@$(dstress) $(torture)nocompile $< > obj/$(notdir $<)$(logsuffix)
	@$(CAT) obj/$(notdir $<)$(logsuffix)
	@$(RM) obj/$(basename $(notdir $<))*

#
# norun
#
norun : $(sort $(patsubst %,%.exe,$(shell $(find) norun $(find_filter))))

norun/%.exe : norun/% tools
	@$(dstress) $(torture)norun $< > obj/$(notdir $<)$(logsuffix)
	@$(CAT) obj/$(notdir $<)$(logsuffix)
	@$(RM) obj/$(basename $(notdir $<))*

#
# run
#
run : $(sort $(patsubst %,%.exe,$(shell $(find) run $(find_filter))))

run/%.exe : run/% tools
	@$(dstress) $(torture)run $< > obj/$(notdir $<)$(logsuffix)
	@$(CAT) obj/$(notdir $<)$(logsuffix)
	@$(RM) obj/$(basename $(notdir $<))*

#
# clean
#
#
clean ::
	$(RM) $(shell $(find) run -name "*exe")
	$(RM) $(shell $(find) norun -name "*exe")
	$(RM) $(shell $(find) compile -name "*exe")
	$(RM) $(shell $(find) nocompile -name "*exe")
	$(RM) obj/[A-E]*.*
	$(RM) obj/[F-J]*.*
	$(RM) obj/[K-O]*.*
	$(RM) obj/[P-T]*.*
	$(RM) obj/[U-Z]*.*
	$(RM) obj/[a-e]*.*
	$(RM) obj/[f-j]*.*
	$(RM) obj/[k-o]*.*
	$(RM) obj/[p-t]*.*
	$(RM) obj/[u-z]*.*
	$(RM) obj/*
	$(RM) run.sh norun.sh compile.sh nocompile.sh
	$(RM) $(dstress) $(crashRun)