Ensure make distclean works on an unconfigured tree

master
David Allsopp 2019-10-15 11:46:36 +01:00
parent cc6c09edbe
commit 13786d7d12
15 changed files with 45 additions and 30 deletions

View File

@ -741,7 +741,7 @@ stdlib/libcamlrun.$(A): runtime/libcamlrun.$(A)
cd stdlib; $(LN) ../runtime/libcamlrun.$(A) .
clean::
$(MAKE) -C runtime clean
rm -f stdlib/libcamlrun.$(A)
rm -f stdlib/libcamlrun.a stdlib/libcamlrun.lib
otherlibs_all := bigarray dynlink raw_spacetime_lib \
str systhreads unix win32unix
@ -771,7 +771,7 @@ runtime/libasmrun.$(A): makeruntimeopt ;
stdlib/libasmrun.$(A): runtime/libasmrun.$(A)
cp $< $@
clean::
rm -f stdlib/libasmrun.$(A)
rm -f stdlib/libasmrun.a stdlib/libasmrun.lib
# The standard library
@ -1010,7 +1010,7 @@ ocamlnat$(EXE): compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa \
$(CAMLOPT_CMD) $(LINKFLAGS) -linkall -o $@ $^
partialclean::
rm -f ocamlnat$(EXE)
rm -f ocamlnat ocamlnat.exe
toplevel/opttoploop.cmx: otherlibs/dynlink/dynlink.cmxa
@ -1053,8 +1053,8 @@ partialclean::
lambda middle_end/closure middle_end/flambda \
middle_end/flambda/base_types asmcomp/debug \
driver toplevel tools; do \
rm -f $$d/*.cm[ioxt] $$d/*.cmti $$d/*.annot $$d/*.$(S) \
$$d/*.$(O) $$d/*.$(SO); \
rm -f $$d/*.cm[ioxt] $$d/*.cmti $$d/*.annot $$d/*.s $$d/*.asm \
$$d/*.o $$d/*.obj $$d/*.so $$d/*.dll; \
done
.PHONY: depend
@ -1068,8 +1068,8 @@ depend: beforedepend
.PHONY: distclean
distclean: clean
rm -f boot/ocamlrun boot/ocamlrun$(EXE) boot/camlheader \
boot/*.cm* boot/libcamlrun.$(A) boot/ocamlc.opt
rm -f boot/ocamlrun boot/ocamlrun boot/ocamlrun.exe boot/camlheader \
boot/*.cm* boot/libcamlrun.a boot/libcamlrun.lib boot/ocamlc.opt
rm -f Makefile.config Makefile.common runtime/caml/m.h runtime/caml/s.h
rm -rf autom4te.cache
rm -f config.log config.status libtool

View File

@ -284,7 +284,8 @@ partialclean::
compilerlibs/ocamlcommon.cmxa: $(COMMON_CMI) $(COMMON:.cmo=.cmx)
$(CAMLOPT) -a -linkall -o $@ $(COMMON:.cmo=.cmx)
partialclean::
rm -f compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.$(A)
rm -f compilerlibs/ocamlcommon.cmxa \
compilerlibs/ocamlcommon.a compilerlibs/ocamlcommon.lib
compilerlibs/ocamlbytecomp.cma: $(BYTECOMP_CMI) $(BYTECOMP)
@ -295,7 +296,8 @@ partialclean::
compilerlibs/ocamlbytecomp.cmxa: $(BYTECOMP_CMI) $(BYTECOMP:.cmo=.cmx)
$(CAMLOPT) -a $(OCAML_NATDYNLINKOPTS) -o $@ $(BYTECOMP:.cmo=.cmx)
partialclean::
rm -f compilerlibs/ocamlbytecomp.cmxa compilerlibs/ocamlbytecomp.$(A)
rm -f compilerlibs/ocamlbytecomp.cmxa \
compilerlibs/ocamlbytecomp.a compilerlibs/ocamlbytecomp.lib
compilerlibs/ocamlmiddleend.cma: $(MIDDLE_END_CMI) $(MIDDLE_END)
@ -305,7 +307,8 @@ compilerlibs/ocamlmiddleend.cmxa: $(MIDDLE_END_CMI) $(MIDDLE_END:%.cmo=%.cmx)
partialclean::
rm -f compilerlibs/ocamlmiddleend.cma \
compilerlibs/ocamlmiddleend.cmxa \
compilerlibs/ocamlmiddleend.$(A)
compilerlibs/ocamlmiddleend.a \
compilerlibs/ocamlmiddleend.lib
compilerlibs/ocamloptcomp.cma: $(OPTCOMP_CMI) $(OPTCOMP)
@ -316,7 +319,8 @@ partialclean::
compilerlibs/ocamloptcomp.cmxa: $(OPTCOMP_CMI) $(OPTCOMP:.cmo=.cmx)
$(CAMLOPT) -a -o $@ $(OPTCOMP:.cmo=.cmx)
partialclean::
rm -f compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamloptcomp.$(A)
rm -f compilerlibs/ocamloptcomp.cmxa \
compilerlibs/ocamloptcomp.a compilerlibs/ocamloptcomp.lib
compilerlibs/ocamltoplevel.cma: $(TOPLEVEL_CMI) $(TOPLEVEL)
@ -328,4 +332,4 @@ compilerlibs/ocamlopttoplevel.cmxa: $(OPTTOPLEVEL_CMI) $(OPTTOPLEVEL:.cmo=.cmx)
$(CAMLOPT) -a -o $@ $(OPTTOPLEVEL:.cmo=.cmx)
partialclean::
rm -f compilerlibs/ocamlopttoplevel.cmxa \
compilerlibs/ocamlopttoplevel.$(A)
compilerlibs/ocamlopttoplevel.a compilerlibs/ocamlopttoplevel.lib

View File

@ -64,7 +64,7 @@ install:
$(INSTALL_PROG) ocamldebug$(EXE) "$(INSTALL_BINDIR)/ocamldebug$(EXE)"
clean::
rm -f ocamldebug$(EXE)
rm -f ocamldebug ocamldebug.exe
rm -f *.cmo *.cmi
.SUFFIXES:

View File

@ -50,7 +50,7 @@ ocamllex.opt: $(OBJS:.cmo=.cmx)
clean::
rm -f ocamllex ocamllex.opt
rm -f *.cmo *.cmi *.cmx *.cmt *.cmti *.$(O)
rm -f *.cmo *.cmi *.cmx *.cmt *.cmti *.o *.obj
parser.ml parser.mli: parser.mly
$(CAMLYACC) $(YACCFLAGS) parser.mly

View File

@ -511,12 +511,13 @@ odoc:
.PHONY: clean
clean:
rm -f \#*\#
rm -f $(OCAMLDOC) $(OCAMLDOC_OPT) *.cma *.cmxa *.cmo *.cmi *.cmx *.cmt *.cmti *.$(A) *.$(O)
rm -f $(OCAMLDOC) $(OCAMLDOC_OPT) *.cma *.cmxa *.cmo *.cmi *.cmx *.cmt *.cmti *.a *.lib *.o *.obj
rm -f odoc_parser.output odoc_text_parser.output
rm -f odoc_lexer.ml odoc_text_lexer.ml odoc_see_lexer.ml odoc_ocamlhtml.ml
rm -f odoc_parser.ml odoc_parser.mli odoc_text_parser.ml odoc_text_parser.mli
rm -rf stdlib_man stdlib_html stdlib_texi stdlib_latex
rm -f generators/*.cm[taiox] generators/*.$(A) generators/*.$(O) generators/*.cmx[as]
rm -f generators/*.cm[taiox] generators/*.a generators/*.lib generators/*.o generators/*.obj \
generators/*.cmx[as]
.PHONY: depend
depend:

View File

@ -277,8 +277,10 @@ ocamltest.html: ocamltest.org
.PHONY: clean
clean:
rm -rf ocamltest$(EXE) ocamltest.opt$(EXE)
rm -rf $(o_files) $(ocaml_objects)
rm -rf ocamltest ocamltest.exe ocamltest.opt ocamltest.opt.exe
rm -rf $(c_files:.c=.o) $(c_files:.c=.obj)
rm -rf run_unix.o run_win32.o run_win32.obj
rm -rf $(ml_files:.ml=.o) $(ml_files:.ml=.obj)
rm -rf $(cmi_files)
rm -rf $(cmo_files)
rm -rf $(cmx_files)

View File

@ -17,6 +17,9 @@ ROOTDIR=..
-include $(ROOTDIR)/Makefile.config
-include $(ROOTDIR)/Makefile.common
OTHERLIBRARIES ?= bigarray dynlink raw_spacetime_lib str systhreads \
unix win32unix
# $1: target name to dispatch to all otherlibs/*/Makefile
define dispatch_
$1:

View File

@ -255,11 +255,12 @@ installopt:
partialclean:
rm -f extract_crc *.cm[ioaxt] *.cmti *.cmxa \
byte/*.cm[iot] byte/*.cmti \
native/*.cm[ixt] native/*.cmti native/*.$(O) \
$(LOCAL_SRC)/*.cm[ioaxt] $(LOCAL_SRC)/*.cmti $(LOCAL_SRC)/*.$(O)
native/*.cm[ixt] native/*.cmti native/*.o native/*.obj \
$(LOCAL_SRC)/*.cm[ioaxt] $(LOCAL_SRC)/*.cmti \
$(LOCAL_SRC)/*.o $(LOCAL_SRC)/*.obj
clean: partialclean
rm -f *.$(A) *.$(O) *.so *.dll dynlink_platform_intf.mli \
rm -f *.a *.lib *.o *.obj *.so *.dll dynlink_platform_intf.mli \
$(LOCAL_SRC)/*.ml $(LOCAL_SRC)/*.mli $(LOCAL_SRC)/Makefile \
$(LOCAL_SRC)/.depend byte/dynlink.mli native/dynlink.mli

View File

@ -113,7 +113,7 @@ partialclean:
rm -f *.cm*
clean: partialclean
rm -f dllthreads*$(EXT_DLL) *.$(A) *.$(O)
rm -f dllthreads*.so dllthreads*.dll *.a *.lib *.o *.obj
INSTALL_THREADSLIBDIR=$(INSTALL_LIBDIR)/$(LIBNAME)

View File

@ -201,7 +201,9 @@ endif
.PHONY: clean
clean:
rm -f $(PROGRAMS) *.$(O) *.$(A) *.$(SO) ld.conf
rm -f *.o *.obj *.a *.lib *.so *.dll ld.conf
rm -f ocamlrun ocamlrund ocamlruni
rm -f ocamlrun.exe ocamlrund.exe ocamlruni.exe
rm -f primitives primitives.new prims.c caml/opnames.h caml/jumptbl.h
rm -f caml/version.h domain_state*.inc

View File

@ -246,7 +246,7 @@ $(OBJS:.cmo=.cmx) std_exit.cmx: stdlib.cmi
$(OTHERS:.cmo=.cmx) std_exit.cmx: stdlib.cmx
clean::
rm -f *.cm* *.$(O) *.$(A) *.odoc
rm -f *.cm* *.o *.obj *.a *.lib *.odoc
rm -f camlheader*
include .depend

View File

@ -47,4 +47,4 @@ testing.cmo : testing.cmi
.PHONY: clean
clean:
rm -f *.cm* *.$(O) *.$(A)
rm -f *.cm* *.o *.obj *.a *.lib

View File

@ -93,6 +93,6 @@ asmgen_i386.obj: asmgen_i386nt.asm
.PHONY: clean
clean:
rm -f *.cm* *.$(O)
rm -f $(tools)
rm -f *.cm* *.o *.obj
rm -f expect_test expect_test.exe codegen codegen.exe
rm -f parsecmm.ml parsecmm.mli lexcmm.ml

View File

@ -310,11 +310,12 @@ lintapidiff.opt: INCLUDES+= -I $(ROOTDIR)/otherlibs/str
lintapidiff.opt: $(LINTAPIDIFF)
$(CAMLOPT_CMD) $(LINKFLAGS) -I $(ROOTDIR) -o $@ $(LINTAPIDIFF)
clean::
rm -f -- lintapidiff.opt lintapidiff.cm? lintapidiff.o
rm -f -- lintapidiff.opt lintapidiff.cm? lintapidiff.o lintapidiff.obj
clean::
rm -f "objinfo_helper$(EXE)" "objinfo_helper$(EXE).manifest"
rm -f "objinfo_helper" "objinfo_helper.manifest"
rm -f "objinfo_helper.exe" "objinfo_helper.exe.manifest"
# Copy a bytecode executable, stripping debug info

View File

@ -45,7 +45,8 @@ version.h : $(ROOTDIR)/VERSION
echo "#define OCAML_VERSION \"`sed -e 1q $< | tr -d '\r'`\"" > $@
clean:
rm -f $(generated_files)
rm -f ocamlyacc ocamlyacc.exe wstr.o wstr.obj version.h \
$(ocamlyacc_SOURCES:.c=.o) $(ocamlyacc_SOURCES:.c=.obj)
depend: