A better makefile for building the Linux client.

http://breakpad.appspot.com/29003

A=nealsid
R=chris masone



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@400 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
nealsid 2009-09-18 20:43:35 +00:00
parent b2bc3bcc84
commit ce9178abaa
2 changed files with 51 additions and 45 deletions

51
src/client/linux/Makefile Normal file
View file

@ -0,0 +1,51 @@
CXX=g++
CC=gcc
CXXFLAGS=-gstabs+ -I../../ -I../../testing/gtest/include -I../../testing/include -I../../testing/gtest -D_REENTRANT -m32
CFLAGS=$(CXXFLAGS)
LDFLAGS=-lpthread
OBJ_DIR=.
BIN_DIR=.
LIB_CC_SRC=handler/exception_handler.cc \
minidump_writer/linux_dumper.cc \
minidump_writer/minidump_writer.cc \
../minidump_file_writer.cc \
../../common/string_conversion.cc \
../../common/linux/guid_creator.cc
LIB_C_SRC = ../../common/convert_UTF.c
LIB_CC_OBJ=$(patsubst %.cc, $(OBJ_DIR)/%.o,$(LIB_CC_SRC))
LIB_C_OBJ=$(patsubst %.c, $(OBJ_DIR)/%.o, $(LIB_C_SRC))
TEST_CC_SRC=handler/exception_handler_unittest.cc \
minidump_writer/directory_reader_unittest.cc \
minidump_writer/line_reader_unittest.cc \
minidump_writer/linux_dumper_unittest.cc \
minidump_writer/minidump_writer_unittest.cc \
../../testing/gtest/src/gtest_main.cc \
../../testing/gtest/src/gtest-all.cc
TEST_CC_OBJ=$(patsubst %.cc, $(OBJ_DIR)/%.o,$(TEST_CC_SRC))
UNITTEST_BIN=$(BIN_DIR)/linux_client_test
BREAKPAD_LIBRARY=$(BIN_DIR)/libbreakpad.a
.PHONY:all clean
all:$(BREAKPAD_LIBRARY) $(UNITTEST_BIN)
check:$(UNITTEST_BIN)
$(UNITTEST_BIN)
$(BIN_DIR)/libbreakpad.a:$(LIB_CC_OBJ) $(LIB_C_OBJ)
$(AR) rcs $@ $^
$(BIN_DIR)/linux_client_test:$(TEST_CC_OBJ) $(BREAKPAD_LIBRARY)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@
clean:
rm -f $(UNITTEST_BIN) $(BREAKPAD_LIBRARY) $(LIB_CC_OBJ) $(LIB_C_OBJ) $(TEST_CC_OBJ) core

View file

@ -1,45 +0,0 @@
CXX=g++
CC=gcc
CXXFLAGS=-gstabs+ -I../../../ -I../../../testing/gtest/include -I../../../testing/include -I../../../testing/gtest -D_REENTRANT -m32
CFLAGS=$(CXXFLAGS)
LDFLAGS=-lpthread
OBJ_DIR=.
BIN_DIR=.
TEST_CC_SRC=exception_handler_unittest.cc \
exception_handler.cc \
../../../testing/gtest/src/gtest-all.cc \
../../../common/linux/guid_creator.cc \
../minidump_writer/minidump_writer.cc \
../../minidump_file_writer.cc \
../minidump_writer/linux_dumper.cc \
../../../testing/gtest/src/gtest_main.cc \
../../../common/string_conversion.cc \
../minidump_writer/directory_reader_unittest.cc \
../minidump_writer/line_reader_unittest.cc \
../minidump_writer/linux_dumper_unittest.cc \
../minidump_writer/minidump_writer_unittest.cc
TEST_C_SRC = ../../../common/convert_UTF.c
TEST_CC_OBJ=$(patsubst %.cc, $(OBJ_DIR)/%.o,$(TEST_CC_SRC))
TEST_C_OBJ=$(patsubst %.c, $(OBJ_DIR)/%.o, $(TEST_C_SRC))
LINUX_CLIENT_BIN=$(BIN_DIR)/linux_client_test
BIN=$(LINUX_CLIENT_BIN)
.PHONY:all clean
check:$(BIN)
$(LINUX_CLIENT_BIN)
all:$(BIN)
$(BIN_DIR)/linux_client_test:$(TEST_CC_OBJ) $(TEST_C_OBJ)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@
clean:
rm -f $(BIN) $(TEST_CC_OBJ) $(TEST_C_OBJ)