2006-04-20 23:13:58 +02:00
|
|
|
##===- tools/llvm-config/Makefile --------------------------*- Makefile -*-===##
|
2006-04-20 22:53:23 +02:00
|
|
|
#
|
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
|
|
|
# This file was developed by Reid Spencer and Eric Kidd and is distributed under
|
|
|
|
# the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
#
|
|
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
|
|
|
|
LEVEL = ../..
|
|
|
|
|
|
|
|
EXTRA_DIST = LibDeps.txt llvm-config.in.in find-cycles.pl
|
|
|
|
|
|
|
|
include $(LEVEL)/Makefile.common
|
|
|
|
|
|
|
|
# Combine preprocessor flags (except for -I) and CXX flags.
|
|
|
|
SUB_CXXFLAGS = ${CPP.BaseFlags} ${CXX.Flags}
|
|
|
|
|
|
|
|
# This is blank for now. We need to be careful about adding stuff here:
|
|
|
|
# LDFLAGS tend not to be portable, and we don't currently require the
|
|
|
|
# user to use libtool when linking against LLVM.
|
|
|
|
SUB_LDFLAGS =
|
|
|
|
|
2006-04-20 23:13:58 +02:00
|
|
|
FinalLibDeps = $(PROJ_SRC_DIR)/FinalLibDeps.txt
|
|
|
|
ifdef HAVE_PERL
|
|
|
|
ifeq ($(HAVE_PERL),1)
|
|
|
|
LibDeps = $(PROJ_SRC_DIR)/LibDeps.txt
|
|
|
|
GenLibDeps = $(PROJ_SRC_ROOT)/utils/GenLibDeps.pl
|
2006-04-20 22:53:23 +02:00
|
|
|
# MANUAL USE ONLY! GenLibDeps.pl is very non-portable, so LibDeps.txt
|
|
|
|
# should only be re-built manually. No other rule in this file should
|
|
|
|
# depend on LibDeps.txt.
|
2006-04-20 23:13:58 +02:00
|
|
|
$(LibDeps): $(GenLibDeps) $(LibDir)
|
2006-04-20 22:53:23 +02:00
|
|
|
$(Echo) "Regenerating LibDeps.txt"
|
2006-04-20 23:13:58 +02:00
|
|
|
$(Verb) $(GenLibDeps) -flat $(LibDir) | sort > $(LibDeps)
|
2006-04-20 22:53:23 +02:00
|
|
|
|
|
|
|
# Find all the cyclic dependencies between various LLVM libraries, so we
|
|
|
|
# don't have to process them at runtime.
|
2006-04-20 23:13:58 +02:00
|
|
|
$(FinalLibDeps): find-cycles.pl $(LibDeps)
|
2006-04-20 22:53:23 +02:00
|
|
|
$(Echo) "Finding cyclic dependencies between LLVM libraries."
|
|
|
|
$(Verb) $(PERL) $< < $(PROJ_SRC_DIR)/LibDeps.txt > $@
|
2006-04-20 23:13:58 +02:00
|
|
|
endif
|
|
|
|
endif
|
2006-04-20 22:53:23 +02:00
|
|
|
|
|
|
|
# Rerun our configure substitutions as needed.
|
2006-04-20 23:13:58 +02:00
|
|
|
ConfigInIn = $(PROJ_SRC_DIR)/llvm-config.in.in
|
|
|
|
llvm-config.in: $(ConfigInIn) $(ConfigStatusScript)
|
2006-04-20 22:53:23 +02:00
|
|
|
$(Verb) cd $(PROJ_OBJ_ROOT) ; \
|
2006-04-20 23:13:58 +02:00
|
|
|
$(ConfigStatusScript) tools/llvm-config/llvm-config.in
|
2006-04-20 22:53:23 +02:00
|
|
|
|
|
|
|
# Build our final script.
|
2006-04-20 23:13:58 +02:00
|
|
|
llvm-config: llvm-config.in $(FinalLibDeps)
|
2006-04-20 22:53:23 +02:00
|
|
|
$(Echo) "Building llvm-config script."
|
|
|
|
$(Verb) $(ECHO) 's,@LLVM_CXXFLAGS@,$(SUB_CXXFLAGS),' > temp.sed
|
|
|
|
$(Verb) $(ECHO) 's,@LLVM_LDFLAGS@,$(SUB_LDFLAGS),' >> temp.sed
|
|
|
|
$(Verb) $(ECHO) 's,@CORE_IS_ARCHIVE@,$(CORE_IS_ARCHIVE),' >> temp.sed
|
|
|
|
$(Verb) $(SED) -f temp.sed < $< > $@
|
|
|
|
$(Verb) $(RM) temp.sed
|
2006-04-20 23:13:58 +02:00
|
|
|
$(Verb) cat $(FinalLibDeps) >> $@
|
2006-04-20 22:53:23 +02:00
|
|
|
$(Verb) chmod +x llvm-config
|
|
|
|
|
|
|
|
# Hook into the standard Makefile rules.
|
|
|
|
all-local:: llvm-config
|
|
|
|
clean-local::
|
2006-04-20 23:13:58 +02:00
|
|
|
$(Verb) $(RM) -f llvm-config llvm-config.in
|
2006-04-20 22:53:23 +02:00
|
|
|
install-local:: all-local
|
|
|
|
$(Echo) Installing llvm-config
|
|
|
|
$(Verb) $(MKDIR) $(PROJ_bindir)
|
|
|
|
$(Verb) $(ScriptInstall) llvm-config $(PROJ_bindir)
|