Chromium Code Reviews| Index: Makefile.standalone |
| diff --git a/Makefile.standalone b/Makefile.standalone |
| index cb0082cee3a5914a7151e50d27f8346a3bd03d80..a74e552c4272322794c8181f291ddd2ad18aebe2 100644 |
| --- a/Makefile.standalone |
| +++ b/Makefile.standalone |
| @@ -37,12 +37,25 @@ else |
| endif |
| endif |
| +# The list of attributes associated with the built executable. |
| +BUILD_ATTS = |
| + |
| +ifdef MINIMAL |
| + OBJDIR := build/min |
|
Jim Stichnoth
2014/10/15 03:16:36
It looks like this creates subdirs build/Release a
Karl
2014/10/15 20:12:31
Done.
|
| + BUILD_ATTS := $(BUILD_ATTS) minimal p2i |
|
Jim Stichnoth
2014/10/15 03:16:36
I think the logic of "minimal" is backwards.
None
Karl
2014/10/15 20:12:31
A better choice would be to put "minimal" when min
|
| +else |
| + OBJDIR = build |
| + BUILD_ATTS := $(BUILD_ATTS) p2i l2i lc2i |
| +endif |
| + |
| ifdef DEBUG |
| - OBJDIR = build/Debug |
| + OBJDIR := $(OBJDIR)/Debug |
| OPTLEVEL = -O0 |
| + BUILD_ATTS := $(BUILD_ATTS) debug |
| else |
| - OBJDIR = build/Release |
| + OBJDIR := $(OBJDIR)/Release |
| OPTLEVEL = -O2 |
| + BUILD_ATTS := $(BUILD_ATTS) release |
| endif |
| ifdef NOASSERT |
| @@ -50,6 +63,7 @@ ifdef NOASSERT |
| else |
| ASSERTIONS = |
| OBJDIR := $(OBJDIR)+Asserts |
| + BUILD_ATTS := $(BUILD_ATTS) asserts |
| endif |
| $(info -----------------------------------------------) |
| @@ -73,6 +87,10 @@ CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \ |
| -Wno-error=unused-parameter -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 |
| LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib |
| +ifdef MINIMAL |
| + CXXFLAGS :=$(CXXFLAGS) -DSZ_MINIMAL |
|
Jim Stichnoth
2014/10/15 03:16:36
I started thinking that maybe instead of a single
Karl
2014/10/15 20:12:31
Went ahead and added multiple flags for correspond
|
| +endif |
| + |
| SRCS= \ |
| assembler.cpp \ |
| assembler_ia32.cpp \ |
| @@ -104,14 +122,16 @@ OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) |
| all: $(OBJDIR)/llvm2ice make_symlink |
| make_symlink: $(OBJDIR)/llvm2ice |
| - rm -f llvm2ice |
| + rm -f llvm2ice llvm2ice.build_atts |
| 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,4 @@ format-diff: |
| $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i |
| clean: |
| - rm -rf llvm2ice *.o build/ |
| + rm -rf llvm2ice llvm2ice.build_atts *.o $(OBJDIR) |
|
Jim Stichnoth
2014/10/15 03:16:36
Shouldn't "make clean" remove the entire build/ di
Karl
2014/10/15 20:12:31
Added "clean-all" to clean all.
|