#-----------------------------------------------------------------------------# # Makefile.mercury - rules for building Mercury programs VPATH=/usr/contrib/lib/mercury/nuprolog/$(shell fullarch):/usr/contrib/lib/mercury/nuprolog/ints #-----------------------------------------------------------------------------# # Default values for certain variables. NC = nc NCFLAGS = -u 800 SHELL = /bin/sh PREFIX = /usr/local/contrib LIBDIR = $(PREFIX)/lib/mercury BINDIR = $(PREFIX)/bin # Do not change this! Change the one in Makefile.common. MERCC = mc #-----------------------------------------------------------------------------# .SUFFIXES: .nl .ns .no .err .int .int2 .dep .depend .doit .ugly .hlds_dump \ .date .c .nu .o .mod .nl.no: mnc $< # The `rm -f' 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?) .nl.err: @rm -f $@ -$(MERCC) $< > $@ 2>&1 .date.int: @true # $*.date => $*.int .date.int2: @true # $*.date => $*.int2 .nl.date: $(MERCC) --make-interface $< .nl.ugly: $(MERCC) --convert-to-mercury $< .nl.hlds_dump: $(MERCC) --verbose --dump-hlds $< .nl.depend: $(MERCC) --verbose --generate-dependencies $< .dep.doit: grep 'srcs *=' $< | \ sed -e 's/.*=/:-[/' \ -e 's/\.nl/,/g' \ -e 's/$$/ '\''nu_library.doit'\'' ]./' \ > $@ .nl.mod: $(MERCC) --generate-code $(MCFLAGS) $< .mod.c: mod2c -s$(GRADE) $< > $@ .mod.o: mod2c -s$(GRADE) $< > $*.c mgnuc -s$(GRADE) -I $(MLIB)/inc -c $*.c -o $@ %_init.c:%.mod mod2init -w "`extract $* '' Entry`" $^ printlist.mod \ engine.mod io.mod wrapper.mod > $@ .c.o: mgnuc -s$(GRADE) -I $(MLIB)/inc -c $< -o $@ #-----------------------------------------------------------------------------# # Clean up some mess xclean: clean_no clean_ns clean_tmp clean_err clean_ints clean_ugly \ clean_hlds_dump clean_xmod clean_o clean_no: -rm -f *.no clean_ns: -rm -f *.ns clean_tmp: -rm -f *.tmp.nl *.tmp.ns tmp.*.nl tmp.*.ns clean_err: -rm -f *.err clean_ints: -rm -f *.int *.int2 *.date clean_ugly: -rm -f *.ugly clean_hlds_dump: -rm -f *.hlds_dump clean_xmod: -rm -f *.xmod clean_o: -rm -f *.o xrealclean: xclean clean_deps clean_saves clean_a_out clean_saves: -rm -f *.save clean_a_out: -rm -f a.out clean_deps: -rm -f *.dep *.d #-----------------------------------------------------------------------------#