clean up makefile and convert to SLOT-ed libbase
This includes a couple of fixes: - use the right compiler flag names - execute pkg-config twice total, and not once per compile - build against SLOT-ed libbase BUG=chromium-os:16623 TEST=`emerge-x86-alex crash-reporter` still works TEST=`cros_run_unit_tests --board x86-alex -p crash-reporter` passes Change-Id: I76fdf552de1c0e10367475f3ad22b6b0b33bfa66 Reviewed-on: https://gerrit.chromium.org/gerrit/17709 Reviewed-by: Ben Chan <benchan@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
parent
6e709a1103
commit
c55dbfd6d8
1 changed files with 13 additions and 12 deletions
|
|
@ -2,6 +2,9 @@
|
|||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
BASE_VER = 85268
|
||||
PKG_CONFIG ?= pkg-config
|
||||
|
||||
CRASH_REPORTER = crash_reporter
|
||||
LIST_PROXIES_BIN = list_proxies
|
||||
REPORTER_BINS = $(CRASH_REPORTER) $(LIST_PROXIES_BIN)
|
||||
|
|
@ -19,37 +22,35 @@ TEST_BINS = \
|
|||
unclean_shutdown_collector_test \
|
||||
user_collector_test
|
||||
|
||||
LDCONFIG = $(shell $(PKG_CONFIG) --libs libpcrecpp)
|
||||
PC_DEPS = glib-2.0 $(LIST_PROXIES_PKGS) libpcrecpp \
|
||||
libchrome-$(BASE_VER) libchromeos-$(BASE_VER)
|
||||
PC_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PC_DEPS))
|
||||
PC_LIBS := $(shell $(PKG_CONFIG) --libs $(PC_DEPS))
|
||||
|
||||
PC_DEPS = glib-2.0 libchromeos $(LIST_PROXIES_PKGS)
|
||||
|
||||
# -lglib-2.0 is needed by libbase.a now.
|
||||
COMMON_LIBS = -lbase -lgflags $(LDCONFIG) \
|
||||
$(shell $(PKG_CONFIG) --libs $(PC_DEPS))
|
||||
COMMON_LIBS = -lgflags $(PC_LIBS)
|
||||
REPORTER_LIBS = $(COMMON_LIBS) -lmetrics
|
||||
LIST_PROXIES_LIBS = $(COMMON_LIBS)
|
||||
|
||||
TEST_LIBS = $(COMMON_LIBS) -lgtest -lgmock
|
||||
INCLUDE_DIRS = -I.. -I$(SYSROOT)/usr/include/google-breakpad \
|
||||
$(shell $(PKG_CONFIG) --cflags $(PC_DEPS))
|
||||
CPPFLAGS += -I.. -I$(SYSROOT)/usr/include/google-breakpad $(PC_CFLAGS)
|
||||
|
||||
CXXFLAGS += -Wall -Werror
|
||||
|
||||
all: $(REPORTER_BINS)
|
||||
|
||||
$(CRASH_REPORTER): crash_reporter.o $(CRASH_OBJS)
|
||||
$(CXX) $(CXXFLAGS) $^ $(REPORTER_LIBS) -o $@
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(REPORTER_LIBS) -o $@
|
||||
|
||||
$(LIST_PROXIES_BIN): $(LIST_PROXIES_OBJS)
|
||||
$(CXX) $(CXXFLAGS) $^ $(LIST_PROXIES_LIBS) -o $@
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(LIST_PROXIES_LIBS) -o $@
|
||||
|
||||
tests: $(TEST_BINS)
|
||||
|
||||
%_test: %_test.o $(TEST_OBJS)
|
||||
$(CXX) $(CXXFLAGS) $(LIB_DIRS) $^ $(TEST_LIBS) -o $@
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(TEST_LIBS) -o $@
|
||||
|
||||
.cc.o:
|
||||
$(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) -c $< -o $@
|
||||
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
rm -rf *.o $(CRASH_BIN) $(LIST_PROXIES_BIN) $(TEST_BINS)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue