Newer
Older
$(BZIP2) -c >$(DistTarBZ2)
dist-zip:: $(DistZip)
$(Echo) Packing zipped distribution file.
$(Verb) rm -f $(DistZip)
$(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName)
dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip)
$(Echo) ===== DISTRIBUTION PACKAGING SUCESSFUL =====
DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir
$(Echo) Checking distribution tar file.
$(Verb) if test -d $(DistCheckDir) ; then \
$(RM) -rf $(DistCheckDir) ; \
fi
$(Verb) $(MKDIR) $(DistCheckDir)
$(Verb) cd $(DistCheckDir) && \
$(MKDIR) $(DistCheckDir)/build && \
$(MKDIR) $(DistCheckDir)/install && \
gunzip -c $(DistTarGZip) | $(TAR) xf - && \
cd build && \
../$(DistName)/configure --prefix="$(DistCheckDir)/install" \
--srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \
$(MAKE) check && \
Bill Wendling
committed
$(MAKE) unittests && \
$(MAKE) install && \
$(MAKE) uninstall && \
$(MAKE) dist-clean && \
$(EchoCmd) ===== $(DistTarGZip) Ready For Distribution =====
$(Echo) Cleaning distribution files
-$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \
$(DistCheckDir)
#------------------------------------------------------------------------
# Provide the recursive distdir target for building the distribution directory
#------------------------------------------------------------------------
distdir: $(DistDir)/.makedistdir
$(DistDir)/.makedistdir: $(DistSources)
$(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
if test -d "$(DistDir)" ; then \
find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \
exit 1 ; \
fi ; \
$(RM) -rf $(DistDir); \
$(EchoCmd) Making 'all' to verify build ; \
$(MAKE) ENABLE_OPTIMIZED=1 all ; \
fi
$(Echo) Building Distribution Directory $(DistDir)
$(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \
srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \
for file in $(DistFiles) ; do \
case "$$file" in \
file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \
;; \
file=`echo "$$file" | \
sed "s#^$$srcrootstrip/##"` \
;; \
if test -f "$(PROJ_SRC_DIR)/$$file" || \
test -d "$(PROJ_SRC_DIR)/$$file" ; then \
from_dir="$(PROJ_SRC_DIR)" ; \
elif test -f "$$file" || test -d "$$file" ; then \
fi ; \
to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \
if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \
to_dir="$(DistDir)/$$dir"; \
$(MKDIR) "$$to_dir" ; \
else \
to_dir="$(DistDir)"; \
fi; \
mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \
if test -n "$$mid_dir" ; then \
$(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \
fi ; \
if test -d "$$from_dir/$$file"; then \
if test -d "$(PROJ_SRC_DIR)/$$file" && \
test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \
cd $(PROJ_SRC_DIR) ; \
$(TAR) cf - $$file --exclude .svn --exclude CVS | \
( cd $$to_dir ; $(TAR) xf - ) ; \
cd $(PROJ_OBJ_DIR) ; \
else \
cd $$from_dir ; \
$(TAR) cf - $$file --exclude .svn --exclude CVS | \
( cd $$to_dir ; $(TAR) xf - ) ; \
cd $(PROJ_OBJ_DIR) ; \
fi; \
elif test -f "$$from_dir/$$file" ; then \
$(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \
$(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \
elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \
$(EchoCmd) "===== WARNING: Distribution Source " \
"$$from_dir/$$file Not Found!" ; \
elif test "$(Verb)" != '@' ; then \
$(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \
$(Verb) for subdir in $(DistSubDirs) ; do \
if test "$$subdir" \!= "." ; then \
new_distdir="$(DistDir)/$$subdir" ; \
test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \
( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \
$(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \
$(EchoCmd) Eliminating CVS/.svn directories from distribution ; \
$(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \
-name .svn \) -print` ;\
$(MAKE) dist-hook ; \
$(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \
-o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \
-o ! -type d ! -perm -400 -exec chmod a+r {} \; \
-o ! -type d ! -perm -444 -exec \
$(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \
|| chmod -R a+r $(DistDir) ; \
fi
# This is invoked by distdir target, define it as a no-op to avoid errors if not
# defined by user.
dist-hook::
endif
###############################################################################
# TOP LEVEL - targets only to apply at the top level directory
###############################################################################
ifeq ($(LEVEL),.)
#------------------------------------------------------------------------
# Install support for the project's include files:
#------------------------------------------------------------------------
ifdef NO_INSTALL
install-local::
$(Echo) Install circumvented with NO_INSTALL
uninstall-local::
$(Echo) Uninstall circumvented with NO_INSTALL
else
$(Echo) Installing include files
$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
NAKAMURA Takumi
committed
for hdr in `find . -type f \
'(' -name LICENSE.TXT \
-o -name '*.def' \
-o -name '*.h' \
-o -name '*.inc' \
-o -name '*.td' \
')' -print | grep -v CVS | \
grep -v .svn` ; do \
instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
if test \! -d "$$instdir" ; then \
$(EchoCmd) Making install directory $$instdir ; \
$(MKDIR) $$instdir ;\
fi ; \
$(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
done ; \
cd $(PROJ_OBJ_ROOT)/include && \
NAKAMURA Takumi
committed
for hdr in `find . -type f \
'(' -name LICENSE.TXT \
-o -name '*.def' \
-o -name '*.h' \
-o -name '*.inc' \
-o -name '*.td' \
')' -print | grep -v CVS | \
grep -v .svn` ; do \
instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
if test \! -d "$$instdir" ; then \
$(EchoCmd) Making install directory $$instdir ; \
$(MKDIR) $$instdir ;\
fi ; \
$(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
done ; \
$(Echo) Uninstalling include files
$(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \
cd $(PROJ_SRC_ROOT)/include && \
$(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
'!' '(' -name '*~' -o -name '.#*' \
grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
cd $(PROJ_SRC_ROOT)/include && \
$(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
-print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
endif
Gabor Greif
committed
@echo searching for overlength lines in files: $(Sources)
@echo
@echo
egrep -n '.{81}' $(Sources) /dev/null
Anton Korobeynikov
committed
check-for-tabs:
Gabor Greif
committed
@echo searching for tabs in files: $(Sources)
@echo
@echo
egrep -n ' ' $(Sources) /dev/null
Gabor Greif
committed
check-footprint:
@ls -l $(LibDir) | awk '\
BEGIN { sum = 0; } \
{ sum += $$5; } \
END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
@ls -l $(ToolDir) | awk '\
BEGIN { sum = 0; } \
{ sum += $$5; } \
END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }'
#------------------------------------------------------------------------
# Print out the directories used for building
#------------------------------------------------------------------------
$(Echo) "BuildMode : " '$(BuildMode)'
$(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)'
$(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)'
$(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)'
$(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)'
$(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)'
$(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)'
$(Echo) "PROJ_prefix : " '$(PROJ_prefix)'
$(Echo) "PROJ_bindir : " '$(PROJ_bindir)'
$(Echo) "PROJ_libdir : " '$(PROJ_libdir)'
$(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)'
$(Echo) "PROJ_includedir : " '$(PROJ_includedir)'
$(Echo) "UserTargets : " '$(UserTargets)'
$(Echo) "ObjMakefiles : " '$(ObjMakefiles)'
$(Echo) "SrcMakefiles : " '$(SrcMakefiles)'
$(Echo) "ObjDir : " '$(ObjDir)'
$(Echo) "LibDir : " '$(LibDir)'
$(Echo) "ToolDir : " '$(ToolDir)'
$(Echo) "ExmplDir : " '$(ExmplDir)'
$(Echo) "Sources : " '$(Sources)'
$(Echo) "TDFiles : " '$(TDFiles)'
$(Echo) "INCFiles : " '$(INCFiles)'
$(Echo) "INCTMPFiles : " '$(INCTMPFiles)'
$(Echo) "PreConditions: " '$(PreConditions)'
$(Echo) "Compile.CXX : " '$(Compile.CXX)'
$(Echo) "Compile.C : " '$(Compile.C)'
$(Echo) "Archive : " '$(Archive)'
$(Echo) "YaccFiles : " '$(YaccFiles)'
$(Echo) "LexFiles : " '$(LexFiles)'
$(Echo) "Module : " '$(Module)'
$(Echo) "SubDirs : " '$(SubDirs)'
$(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)'
$(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)'
###
# Debugging
# General debugging rule, use 'make dbg-print-XXX' to print the
# definition, value and origin of XXX.
make-print-%:
$(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))