Permalink
Browse files

Simplify makefile

make dist should now be git archive.
  • Loading branch information...
kerneis committed Nov 4, 2011
1 parent 09ff7f6 commit de08b66ac9dd5f223b11b9ed60bb5c4330d09679
Showing with 24 additions and 173 deletions.
  1. +4 −0 .gitattributes
  2. +1 −0 .gitignore
  3. +19 −173 Makefile.in
View
@@ -0,0 +1,4 @@
+/configure binary
+/index.html export-ignore
+/.gitignore export-ignore
+/.gitattributes export-ignore
View
@@ -41,6 +41,7 @@
/_log
/META
/README
+/index.html
# /bin/
/bin/scaninfer.bat
View
@@ -334,9 +334,6 @@ ODOC_FILES = ocamlutil/pretty.mli ocamlutil/errormsg.mli \
src/ext/dominators.mli
-README: README.md

This comment has been minimized.

Show comment Hide comment
@wh5a

wh5a Nov 7, 2011

Now that this target has been removed, you can remove the 'rm README' line from the distclean target.

@wh5a

wh5a Nov 7, 2011

Now that this target has been removed, you can remove the 'rm README' line from the distclean target.

This comment has been minimized.

Show comment Hide comment
@kerneis

kerneis Nov 7, 2011

Contributor
@kerneis

kerneis via email Nov 7, 2011

Contributor
- cp $^ $@
-
# Documentation generated by "ocamldoc"
odoc: $(OBJDIR)/pretty.cmi $(OBJDIR)/cil.cmi
-rm -rf doc/html/cil/api doc/html/cil/api-latex
@@ -387,146 +384,6 @@ pdfdoc: doc/cilpp.tex $(OBJDIR)/pretty.cmi $(OBJDIR)/cil.cmi
# correctly.
doc: texdoc pdfdoc odoc
-
-#----------------------------------------------------------------------
-# Generate the CIL distribution
-# This will create a file cil.tar.gz. It includes the HTML documentation
-# so that people can use it even if they don't have ocamldoc, hevea etc.
-
-.PHONY: distrib distrib-nocheck checkdistrib
-CIL_TAR_GZ:=cil-@CIL_VERSION@.tar.gz
-## Make a distribution and check it
-distrib: distrib-nocheck checkdistrib
-
-# Work in a temporary directory
-TEMP_DIR = TEMP_cil-distrib
-
-# The tar archive members will be relative to this directory
-TOP_DIR = $(TEMP_DIR)/cil-@CIL_VERSION@
-
-DISTRIB_ROOT = README LICENSE Makefile.in \
- config.h.in config.mk.in Makefile.gcc Makefile.msvc \
- configure configure.in install-sh config.guess config.sub \
- cil.spec cil.spec.in \
- _tags \
- aclocal.m4 \
- cil.itarget \
- doc/cil.odocl \
- myocamlbuild.ml
-
-DISTRIB_SRC = cilutil.ml cil.ml cil.mli check.ml check.mli \
- rmtmps.ml rmtmps.mli formatlex.mll formatparse.mly \
- formatcil.mli formatcil.ml testcil.ml \
- mergecil.ml mergecil.mli main.ml machdep-ml.c.in machdepenv.ml \
- ciloptions.ml ciloptions.mli libmaincil.ml \
- escape.ml escape.mli cillower.mli cillower.ml cilint.ml \
- _tags \
- cil.mllib \
- cilversion.ml.in
-
-DISTRIB_OCAMLUTIL = pretty.ml pretty.mli errormsg.ml errormsg.mli \
- trace.ml trace.mli stats.ml stats.mli util.ml util.mli \
- inthash.ml inthash.mli alpha.ml alpha.mli \
- intmap.ml intmap.mli clist.ml clist.mli \
- longarray.ml longarray.mli \
- growArray.ml growArray.mli \
- bitmap.ml bitmap.mli \
- Makefile.ocaml \
- _tags
-
-
-DISTRIB_SRC_FRONTC = cabs.ml cabshelper.ml cprint.ml clexer.mli clexer.mll \
- cparser.mly whitetrack.mli whitetrack.ml lexerhack.ml \
- cabs2cil.ml cabs2cil.mli frontc.ml frontc.mli \
- cabsvisit.mli cabsvisit.ml patch.mli patch.ml
-
-DISTRIB_SRC_EXT = logcalls.ml logcalls.mli \
- astslicer.ml heap.ml partial.ml \
- logwrites.ml heapify.ml callgraph.ml callgraph.mli \
- epicenter.ml usedef.ml ciltools.ml \
- deadcodeelim.ml availexps.ml \
- dataflow.ml dataflow.mli \
- dominators.ml dominators.mli \
- ssa.ml ssa.mli \
- stackoverflow.mli stackoverflow.ml \
- canonicalize.ml canonicalize.mli \
- oneret.ml oneret.mli sfi.ml \
- simplemem.ml simplify.ml simplify.mli \
- blockinggraph.ml blockinggraph.mli \
- dataslicing.ml dataslicing.mli \
- _tags \
- reachingdefs.ml \
- cfg.ml cfg.mli \
- liveness.ml \
- expcompare.ml \
- availexpslv.ml \
- predabst.ml \
- llvm.ml llvmgen.ml llvmssa.ml llvmutils.ml
-
-DISTRIB_SRC_EXT_PTA = setp.ml setp.mli golf.ml golf.mli \
- ptranal.ml ptranal.mli \
- steensgaard.mli steensgaard.ml \
- uref.ml uref.mli olf.ml olf.mli
-
-DISTRIB_LIB = Cilly.pm.in KeptFile.pm OutputFile.pm TempFile.pm
-
-DISTRIB_BIN = CilConfig.pm.in cilly cilly.bat.in \
- patcher patcher.bat.in test-bad teetwo
-
-DISTRIB_SMALL1=hello.c func.c init.c init1.c wchar1.c vararg1.c testharness.h
-
-distrib-nocheck: $(DISTRIB_ROOT) doc
- # Create the distribution from scratch
- rm -rf $(TEMP_DIR)
- mkdir $(TEMP_DIR)
-
- rm -rf $(CIL_TAR_GZ)
- mkdir $(TOP_DIR) \
- $(TOP_DIR)/bin \
- $(TOP_DIR)/doc \
- $(TOP_DIR)/doc/api \
- $(TOP_DIR)/debian \
- $(TOP_DIR)/lib \
- $(TOP_DIR)/obj \
- $(TOP_DIR)/obj/.depend \
- $(TOP_DIR)/src \
- $(TOP_DIR)/src/frontc \
- $(TOP_DIR)/src/ext \
- $(TOP_DIR)/src/ext/pta \
- $(TOP_DIR)/test \
- $(TOP_DIR)/test/small1 \
- $(TOP_DIR)/ocamlutil
-
- cp $(patsubst %,%,$(DISTRIB_ROOT)) $(TOP_DIR)
-
- cp $(patsubst %,src/%,$(DISTRIB_SRC)) $(TOP_DIR)/src
- cp $(patsubst %,ocamlutil/%,$(DISTRIB_OCAMLUTIL)) $(TOP_DIR)/ocamlutil
- cp $(patsubst %,src/ext/%,$(DISTRIB_SRC_EXT)) $(TOP_DIR)/src/ext
- cp $(patsubst %,src/ext/pta/%,$(DISTRIB_SRC_EXT_PTA)) \
- $(TOP_DIR)/src/ext/pta
- cp $(patsubst %,src/frontc/%,$(DISTRIB_SRC_FRONTC)) \
- $(TOP_DIR)/src/frontc
- cp $(patsubst %,lib/%,$(DISTRIB_LIB)) $(TOP_DIR)/lib
- cp $(patsubst %,bin/%,$(DISTRIB_BIN)) $(TOP_DIR)/bin
- cp $(patsubst %,test/small1/%,$(DISTRIB_SMALL1)) $(TOP_DIR)/test/small1
-
- cp -r doc/html/cil/* $(TOP_DIR)/doc
- cp debian/* $(TOP_DIR)/debian
-
-# Delete all Subversion metadata directories
- find $(TEMP_DIR) -name .svn -print0 | xargs -0 rm -rf
-
-# Now make the TAR ball
- cd $(TEMP_DIR); tar cfz $(CIL_TAR_GZ) cil-@CIL_VERSION@
- mv $(TEMP_DIR)/$(CIL_TAR_GZ) .
-
-# rm -rf $(TEMP_DIR)
-
-## Check a distribution
-checkdistrib:
- cd $(TOP_DIR) && ./configure && \
- $(MAKE) && $(MAKE) quicktest
-
distclean: clean
rm -f src/frontc/cparser.output
rm -f src/formatparse.output
@@ -584,44 +441,33 @@ datarootdir = @datarootdir@
libdir = @libdir@
pkglibdir = $(libdir)/cil
libexecdir = @libexecdir@
-pkglibexecdir = $(libexecdir)/cil/$(OBJDIR)
+pkglibexecdir = $(libexecdir)/cil
bindir = @bindir@
# Hack - I don't know how to find perl_vendorlib
perl_vendorlib = $(libdir)
-all_distrib := $(DISTRIB_OCAMLUTIL) $(DISTRIB_SRC) $(DISTRIB_SRC_FRONTC) $(DISTRIB_SRC_EXT) $(DISTRIB_SRC_EXT_PTA)
-all_ml := $(filter %.ml, $(all_distrib))
-all_mli := $(filter %.mli, $(all_distrib))
-install_ml := $(filter $(OCAML_CIL_LIB_MODULES:=.ml), $(all_ml))
-install_cmx := $(install_ml:%.ml=$(OBJDIR)/%.cmx)
-install_mli := $(filter $(OCAML_CIL_LIB_MODULES:=.mli), $(all_mli))
-install_cmi := $(install_mli:%.mli=$(OBJDIR)/%.cmi)
-install_cmx := $(install_mli:%.mli=$(OBJDIR)/%.cmx)
-install_cma := $(addprefix $(OBJDIR)/cil., cma cmxa a)
-
-install: $(install_cmi) $(install_cma) $(install_lib)
- $(INSTALL) -d $(DESTDIR)$(pkglibdir)
- $(INSTALL_DATA) $(install_cma) $(DESTDIR)$(pkglibdir)
- $(INSTALL_DATA) $(install_cmi) $(DESTDIR)$(pkglibdir)
- $(INSTALL_DATA) $(install_cmx) $(DESTDIR)$(pkglibdir)
+install: install-findlib
+ $(INSTALL) -d $(DESTDIR)$(perl_vendorlib)
$(INSTALL) -m 0644 lib/*.pm bin/CilConfig.pm $(DESTDIR)$(perl_vendorlib)
sed -i "s,^.*cilhome.*$$,\$$::cilhome = \"$(libexecdir)/cil\";," $(DESTDIR)$(perl_vendorlib)/CilConfig.pm
$(INSTALL) -d $(DESTDIR)$(bindir)
$(INSTALL) -m 0755 bin/cilly $(DESTDIR)$(bindir)
- $(INSTALL) -d $(DESTDIR)$(pkglibexecdir)
- $(INSTALL) -m 0755 $(OBJDIR)/cilly.*.exe $(DESTDIR)$(pkglibexecdir)
-
-uninstall:
- -rm -rf $(DESTDIR)$(pkglibdir)
-
-cil.spec: cil.spec.in
- ./config.status $@
-
-rpms: distrib
- rpmbuild -ta $(CIL_TAR_GZ)
-
-install-findlib: $(install_cmi) $(install_cma) $(install_cmx) META
- ocamlfind install cil META $(install_cma) $(install_cmi) $(install_cmx)
+ $(INSTALL) -d $(DESTDIR)$(pkglibexecdir)/$(OBJDIR)
+ $(INSTALL) -m 0755 $(OBJDIR)/cilly.*.exe $(DESTDIR)$(pkglibexecdir)/$(OBJDIR)
+
+# FIXME
+uninstall: uninstall-findlib
+ -rm -rf $(DESTDIR)$(pkglibexecdir)
+ -rm -f $(DESTDIR)$(bindir)/cilly
+ -rm -f $(DESTDIR)$(perl_vendorlib)/CilConfig.pm $(DESTDIR)$(perl_vendorlib)/Cilly.pm \
+ $(DESTDIR)$(perl_vendorlib)/KeptFile.pm $(DESTDIR)$(perl_vendorlib)/OutputFile.pm \
+ $(DESTDIR)$(perl_vendorlib)/TempFile.pm
+
+EVERYTHING=$(OBJDIR)/*.cmi $(OBJDIR)/*.cmo $(OBJDIR)/*.cmx $(OBJDIR)/*.cma \
+ $(OBJDIR)/*.cmxa $(OBJDIR)/*.o $(OBJDIR)/*.a src/*.mli src/ext/*.mli src/frontc/*.mli
+
+install-findlib: all $(EVERYTHING)
+ ocamlfind install cil META $^
uninstall-findlib:
ocamlfind remove cil

0 comments on commit de08b66

Please sign in to comment.