mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 02:43:40 +00:00
73 lines
1.4 KiB
Makefile
73 lines
1.4 KiB
Makefile
#-----------------------------------------------------------------------------#
|
|
|
|
MLIB=/usr/contrib/lib/mercury
|
|
#GRADE=fast
|
|
#MCFLAGS=--optimize --gcc-global-registers --gcc-non-local-gotos
|
|
GRADE=debug
|
|
MCFLAGS=--debug
|
|
|
|
VPATH=$(MLIB)/nuprolog/$(shell fullarch):$(MLIB)/ints:$(MLIB)/modules
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
.PRECIOUS: %.mod %.c %.o %_init.c %.no %.nu %_init.nl %_init.no
|
|
|
|
# MOD2INIT=mod2init -w "`extract $* '' Entry`" $^ printlist.mod \
|
|
engine.mod io.mod wrapper.mod > $@
|
|
|
|
%.mod: printlist.int
|
|
|
|
%_init.c: Entry
|
|
|
|
%_init.c: %.mod printlist.mod /usr/contrib/lib/mercury/modules/*
|
|
$(MOD2INIT) -w"`extract $* '' Entry`" $^ > $@
|
|
|
|
%_init.nl: NP_Entry
|
|
echo "main(_) :- `extract $* '' NP_Entry`." > $@
|
|
|
|
%: %.o %_init.o printlist.o
|
|
$(ML) -s$(GRADE) $(MLFLAGS) -o $@ $^
|
|
|
|
%.out: %
|
|
./$< > $@ 2>&1
|
|
|
|
%.exp: %.nu
|
|
./$< > $@ 2>&1
|
|
|
|
%.res: %.exp %.out
|
|
diff -u $*.exp $*.out > $@
|
|
|
|
%.nu : %.no %_init.no printlist.no
|
|
mnl -o $@ $^
|
|
|
|
clean: clean_mod clean_c clean_out clean_exp clean_res clean_nl_init
|
|
|
|
clean_mc: clean_mod clean_c clean_o clean_out clean_res
|
|
|
|
clean_mod:
|
|
rm -f *.mod
|
|
|
|
clean_c:
|
|
rm -f *.c
|
|
|
|
clean_out:
|
|
rm -f *.out
|
|
|
|
clean_exp:
|
|
rm -f *.exp
|
|
|
|
clean_res:
|
|
rm -f *.res
|
|
|
|
clean_nl_init:
|
|
rm -f *_init.nl
|
|
|
|
realclean: clean_nu
|
|
|
|
clean_nu:
|
|
rm -f *.nu
|
|
|
|
-include *.d
|
|
|
|
#-----------------------------------------------------------------------------#
|