Files
mercury/scripts/Mmake.rules
Fergus Henderson 36599a2060 Delete calls to `chmod -r'. Turning off read permission seems
Estimated hours taken: 0.5

configure.in:
scripts/Mmake.rules:
	Delete calls to `chmod -r'.  Turning off read permission seems
	to cause more problems than it solves.  Amoung other things,
	it causes problems on systems such as Windows where you can't
	delete a read-only file.  (GNU-win32 has some work-arounds for
	that, but there are bugs in the work-arounds.)
	We should probably also delete the various calls to `chmod +w',
	since they are no longer needed, but for the moment I have left
	them in for backwards compatibility.  We can reconsider this
	in a year or two's time.
1997-11-21 12:34:19 +00:00

146 lines
3.2 KiB
Plaintext

#-----------------------------------------------------------------------------#
# Copyright (C) 1995-1997 The University of Melbourne.
# This file may only be copied under the terms of the GNU General
# Public License - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#
# Mmake.rules - rules for building Mercury programs
main_target: $(MAIN_TARGET)
#-----------------------------------------------------------------------------#
# Beware that the order of suffixes is significant.
.SUFFIXES: .m .nl .no .err .int .int2 .int3 .opt .dep .depend .doit \
.ugly .date .date3 .optdate .c .nu .o .pic_o \
.i .s .pic_s \
.ql .pl
.PRECIOUS: %.date %.date3 %.optdate
# All the builtin rules must use $@ as the target, so that they work
# when $(VPATH) is set.
.m.no:
$(MNC) $(MNCFLAGS) -o $@ $<
.nl.no:
$(MNC) $(MNCFLAGS) -o $@ $<
.m.ql:
$(MSC) $(MSCFLAGS) -o $@ $<
.nl.ql:
$(MSC) $(MSCFLAGS) -o $@ $<
.m.pl:
sicstus_conv $<
.nl.pl:
sicstus_conv $<
# The `touch' is necessary, since otherwise if
# the old .err file was of size zero and
# the new .err file is also of size zero,
# the time-stamp doesn't get updated!
# (Is that a bug in unix? In bash?)
.m.err:
$(MC) $(MCFLAGS) --errorcheck-only $< > $@ 2>&1
@touch $@
.m.date:
$(MCI) $(MCIFLAGS) $<
.m.date3:
$(MCSI) $(MCSIFLAGS) $<
.m.optdate:
$(MCOI) $(MCOIFLAGS) $<
# Be very careful about changing the following rules.
# The `@:' is a silent do-nothing command.
# It is used to force GNU Make to recheck the timestamp
# on the target file. (It is a pity that GNU Make doesn't
# have a way of handling these sorts of rules in a nicer manner.)
.date.int:
@:
.date.int2:
@:
.date3.int3:
@:
.optdate.opt:
@:
.m.ugly:
$(MC) --convert-to-mercury $(MCFLAGS) $<
.m.dep:
@-[ ! -f $*.dep ] || chmod +w $*.dep
$(MCD) $(MCDFLAGS) $<
.m.depend:
@-[ ! -f $*.dep ] || chmod +w $*.dep
$(MCD) $(MCDFLAGS) $<
-rm -f $*_init.c
.dep.doit:
sed -e ':a' -e '/\\/N' -e 's/\\\n //' -e 't a' $< | \
tee tmp | \
grep 'srcs *=' | \
sed -e 's/.*=/:-[ '\''nu_library.doit'\'', /' \
-e 's/\.nl/,/g' \
-e 's/$$/ portray ]./' \
> $@
.m.c:
rm -f $*.c
$(MCG) $(GRADEFLAGS) $(MCGFLAGS) $< > $*.err 2>&1
.c.o:
$(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) -c $< -o $@
# .c.pic_o:
# $(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) $(CFLAGS_FOR_PIC) -c $< -o $@
.c.s:
$(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) -S $< -o $@
.c.pic_s:
$(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) $(CFLAGS_FOR_PIC) -S $< -o $@
.c.i:
$(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) -E $< > $@
.m.o:
$(MMAKE_MAKE_CMD) $(MAKEOVERRIDES) $*.c
$(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) -c $*.c -o $@
$(RM_C) $*.c
.o.pic_o:
$(MMAKE_MAKE_CMD) $(MAKEOVERRIDES) $*.c
$(MGNUC) $(GRADEFLAGS) $(MGNUCFLAGS) $(CFLAGS_FOR_PIC) -c $*.c -o $@
$(RM_C) $*.c
%.dir/*.o: %.m
rm -f $@
$(MCS) $(GRADEFLAGS) $(MCSFLAGS) $<
#-----------------------------------------------------------------------------#
# The actions for `mmake clean' etc. are in the `.d' files.
.PHONY: clean realclean clean_nu clean_sicstus
realclean: clean clean_prof_files
clean_prof_files:
-rm -f Prof.CallPair Prof.Counts Prof.Decl
-rm -f *.prof
#-----------------------------------------------------------------------------#