Chromium Code Reviews| Index: Makefile.standalone |
| diff --git a/Makefile.standalone b/Makefile.standalone |
| index cb0082cee3a5914a7151e50d27f8346a3bd03d80..5d2772548ab6a5a93ab2adeb221b82aef4879cd4 100644 |
| --- a/Makefile.standalone |
| +++ b/Makefile.standalone |
| @@ -37,12 +37,28 @@ else |
| endif |
| endif |
| +# The list of CXX defines that are dependent on build parameters. |
| +CXX_DEFINES = |
| + |
| +# The list of attributes associated with the built executable. |
| +BUILD_ATTS = x86-32 |
| + |
| ifdef DEBUG |
| OBJDIR = build/Debug |
| OPTLEVEL = -O0 |
| + BUILD_ATTS := $(BUILD_ATTS) debug |
|
Jim Stichnoth
2014/10/20 16:44:28
I don't know if this is possible, but I wonder if
Karl
2014/10/20 21:00:42
Done.
|
| else |
| OBJDIR = build/Release |
| OPTLEVEL = -O2 |
| + BUILD_ATTS := $(BUILD_ATTS) release |
| +endif |
| + |
| +ifdef MINIMAL |
| + CXX_DEFINES := $(CXX_DEFINES) -DNO_TEXT_ASM -DNO_DUMP -DNO_LLVM_CL |
| + OBJDIR := $(OBJDIR)+Min |
| + BUILD_ATTS := $(BUILD_ATTS) minimal |
| +else |
| + BUILD_ATTS := $(BUILD_ATTS) nonminimal |
| endif |
| ifdef NOASSERT |
| @@ -50,6 +66,7 @@ ifdef NOASSERT |
| else |
| ASSERTIONS = |
| OBJDIR := $(OBJDIR)+Asserts |
| + BUILD_ATTS := $(BUILD_ATTS) asserts |
| endif |
| $(info -----------------------------------------------) |
| @@ -69,8 +86,9 @@ CCACHE := `command -v ccache` |
| CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++ |
| CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \ |
| - -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) -g $(HOST_FLAGS) \ |
| - -Wno-error=unused-parameter -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 |
| + -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) $(CXX_DEFINES) -g \ |
| + $(HOST_FLAGS) -Wno-error=unused-parameter \ |
| + -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 |
| LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib |
| SRCS= \ |
| @@ -103,15 +121,17 @@ OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) |
| # Keep all the first target so it's the default. |
| all: $(OBJDIR)/llvm2ice make_symlink |
| -make_symlink: $(OBJDIR)/llvm2ice |
| - rm -f llvm2ice |
| +make_symlink: $(OBJDIR)/llvm2ice $(OBJDIR)/llvm2ice.build_atts |
| + rm -f llvm2ice llvm2ice.build_atts |
|
Jim Stichnoth
2014/10/20 16:44:28
Can you change to rm -rf in case a directory of th
Karl
2014/10/20 21:00:42
Done.
|
| ln -s $(OBJDIR)/llvm2ice |
| + ln -s $(OBJDIR)/llvm2ice.build_atts |
| .PHONY: all make_symlink |
| $(OBJDIR)/llvm2ice: $(OBJS) |
| $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \ |
| -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) |
| + echo "$(BUILD_ATTS)" > $@.build_atts |
| # TODO: Be more precise than "*.h" here and elsewhere. |
| $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def |
| @@ -149,4 +169,7 @@ format-diff: |
| $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i |
| clean: |
| - rm -rf llvm2ice *.o build/ |
| + rm -rf llvm2ice llvm2ice.build_atts *.o $(OBJDIR) |
| + |
| +clean-all: clean |
| + rm -rf build/ |