Commit bc2e9424 authored by shibakaneki's avatar shibakaneki

Merge remote-tracking branch 'origin/master'

parents 0055bf39 94b9ce0f
......@@ -46,10 +46,7 @@
#include <QDataStream>
static quint32 magicNumber = 0xACDCAFE0;
static QString applicationsVirtualPath = "$applications$";
static QString picturesVirtualPath = "$pictures$";
static QString favoriteVirtualPath = "$favorite$";
static QString interactivesCategoryPath;
UBLibraryController::UBLibraryController(QWidget *pParentWidget, UBBoardController *pBoardController) :
QObject(pParentWidget),
......@@ -80,6 +77,8 @@ UBLibraryController::UBLibraryController(QWidget *pParentWidget, UBBoardControll
mPicturesStandardDirectoryPath = QUrl::fromLocalFile(UBDesktopServices::storageLocation(QDesktopServices::PicturesLocation));
userPath(mPicturesStandardDirectoryPath);
mInteractiveUserDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->uniboardInteractiveUserDirectory());
createInternalWidgetItems();
}
......@@ -224,14 +223,13 @@ QList<UBLibElement*> UBLibraryController::rootCategoriesList()
element->setMoveable(false);
categories << element;
element = new UBLibElement(eUBLibElementType_Folder, mVideoStandardDirectoryPath, tr("Movies", "Movies category element"));
categoryImage = new QImage(":images/libpalette/MoviesCategory.svg");
element->setThumbnail(categoryImage);
element->setMoveable(false);
categories << element;
element = new UBLibElement(eUBLibElementType_VirtualFolder, picturesVirtualPath, tr("Pictures", "Pictures category element"));
element = new UBLibElement(eUBLibElementType_Folder, mPicturesStandardDirectoryPath, tr("Pictures", "Pictures category element"));
categoryImage = new QImage(":images/libpalette/PicturesCategory.svg");
element->setThumbnail(categoryImage);
element->setMoveable(false);
......@@ -246,7 +244,7 @@ QList<UBLibElement*> UBLibraryController::rootCategoriesList()
categoryImage = new QImage(":images/libpalette/ApplicationsCategory.svg");
element = new UBLibElement(eUBLibElementType_VirtualFolder, applicationsVirtualPath, tr("Applications", "Applications category element"));
element = new UBLibElement(eUBLibElementType_Folder, mInteractiveUserDirectoryPath, tr("Applications", "Applications category element"));
element->setThumbnail(categoryImage);
element->setMoveable(false);
categories << element;
......@@ -258,8 +256,8 @@ QList<UBLibElement*> UBLibraryController::rootCategoriesList()
categories << element;
categoryImage = new QImage(":images/libpalette/InteractivesCategory.svg");
interactivesCategoryPath = UBSettings::settings()->uniboardGipLibraryDirectory();
element = new UBLibElement(eUBLibElementType_Folder, QUrl::fromLocalFile(interactivesCategoryPath), tr("Interactives", "Interactives category element"));
mInteractiveCategoryPath = QUrl::fromLocalFile(UBSettings::settings()->uniboardGipLibraryDirectory());
element = new UBLibElement(eUBLibElementType_Folder, mInteractiveCategoryPath, tr("Interactives", "Interactives category element"));
element->setThumbnail(categoryImage);
element->setMoveable(false);
categories << element;
......@@ -315,9 +313,27 @@ QImage* UBLibraryController::thumbnailForFile(UBLibElement* pElement)
return createThumbnail(pElement);
}
QList<UBLibElement*> UBLibraryController::listElementsInPath(const QString& pPath)
QList<UBLibElement*> UBLibraryController::addVirtualElementsForItemPath(const QString& pPath)
{
QList<UBLibElement*> content;
if (pPath == mInteractiveCategoryPath.toString())
content << mInternalLibElements;
else if (pPath == mPicturesStandardDirectoryPath.toLocalFile()){
QUrl path = QUrl::fromLocalFile(UBSettings::settings()->uniboardImageLibraryDirectory());
userPath(path);
content << listElementsInPath(path.toLocalFile());
}
else if (pPath == mInteractiveUserDirectoryPath.toLocalFile()){
content << listElementsInPath(UBSettings::settings()->uniboardInteractiveLibraryDirectory());
content << listElementsInPath(UBSettings::settings()->uniboardInteractiveFavoritesDirectory());
}
return content;
}
QList<UBLibElement*> UBLibraryController::listElementsInPath(const QString& pPath)
{
QList<UBLibElement*> content = addVirtualElementsForItemPath(pPath);
QFileInfoList fileInfoList = UBFileSystemUtils::allElementsInDirectory(pPath);
QFileInfoList::iterator fileInfo;
......@@ -346,56 +362,14 @@ QList<UBLibElement*> UBLibraryController::listElementsInPath(const QString& pPat
content << element;
}
if (pPath == interactivesCategoryPath)
content << mInternalLibElements;
return content;
}
QList<UBLibElement*> UBLibraryController::elementsInPicturesVirtualForlder()
{
QList<UBLibElement*> content;
UBLibElement *element = new UBLibElement(eUBLibElementType_Folder, mPicturesStandardDirectoryPath, tr("User Pictures", "User Pictures directory"));
QImage* categoryImage = new QImage(":images/libpalette/PicturesCategory.svg");
element->setThumbnail(categoryImage);
content << element;
QUrl path = QUrl::fromLocalFile(UBSettings::settings()->uniboardImageLibraryDirectory());
userPath(path);
element = new UBLibElement(eUBLibElementType_Folder, path,tr("Sankoré 3.1 Pictures", "Sankoré 3.1 Pictures directory"));
element->setThumbnail(categoryImage);
content << element;
return content;
}
QList<UBLibElement*> UBLibraryController::elementsInApplicationsVirtualForlder()
{
QList<UBLibElement*> content;
UBLibElement *element = new UBLibElement(eUBLibElementType_Folder, QUrl::fromLocalFile(UBSettings::settings()->uniboardInteractiveLibraryDirectory()), tr("Sankoré Interactive"));
content << element;
element = new UBLibElement(eUBLibElementType_Folder, QUrl::fromLocalFile(UBSettings::settings()->uniboardInteractiveUserDirectory()), tr("User Interactive"));
content << element;
element = new UBLibElement(eUBLibElementType_Folder, QUrl::fromLocalFile(UBSettings::settings()->uniboardInteractiveFavoritesDirectory()), tr("Favorite Interactive"));
content << element;
return content;
}
QList<UBLibElement*> UBLibraryController::listElementsInVirtualForlder(UBLibElement* pElement)
{
if (pElement->path() == applicationsVirtualPath)
return elementsInApplicationsVirtualForlder();
else if (pElement->path() == picturesVirtualPath)
return elementsInPicturesVirtualForlder();
else
return mFavoriteList;
return mFavoriteList;
}
void UBLibraryController::moveContent(QList<UBLibElement*> sourceList, UBLibElement *pDestination)
......
......@@ -103,8 +103,8 @@ class UBLibraryController : public QObject
void addToFavorite(QList<UBLibElement*> elementList);
void removeFromFavorite(QList<UBLibElement*> elementList);
void importItemOnLibrary(QString& pItemString);
void importImageOnLibrary(QImage &pImage);
void importItemOnLibrary(QString& pItemString);
void importImageOnLibrary(QImage &pImage);
QString favoritePath();
......@@ -169,16 +169,17 @@ class UBLibraryController : public QObject
void userPath(QUrl &pPath);
QImage* thumbnailForFile(UBLibElement* pPath);
QImage* createThumbnail(UBLibElement* pPath);
QList<UBLibElement*> elementsInPicturesVirtualForlder();
QList<UBLibElement*> elementsInApplicationsVirtualForlder();
QList<UBLibElement*> addVirtualElementsForItemPath(const QString& pPath);
void createInternalWidgetItems();
void routeItem(QString& pItem, QString pMiddleDirectory = QString());
void createDirectory(QUrl& pDirPath);
void createDirectory(QUrl& pDirPath);
QUrl mAudioStandardDirectoryPath;
QUrl mVideoStandardDirectoryPath;
QUrl mPicturesStandardDirectoryPath;
QUrl mAudioStandardDirectoryPath;
QUrl mVideoStandardDirectoryPath;
QUrl mPicturesStandardDirectoryPath;
QUrl mInteractiveUserDirectoryPath;
QUrl mInteractiveCategoryPath;
QStringList addItemsToCurrentLibrary(const QDir& pSelectedFolder, const QStringList& pExtensions);
......
#
# FreeType 2 build system -- top-level Makefile
#
# Copyright 1996-2000, 2002, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
# Project names
#
PROJECT := freetype
PROJECT_TITLE := FreeType
# The variable TOP_DIR holds the path to the topmost directory in the project
# engine source hierarchy. If it is not defined, default it to `.'.
#
TOP_DIR ?= .
# The variable OBJ_DIR gives the location where object files and the
# FreeType library are built.
#
OBJ_DIR ?= $(TOP_DIR)/objs
include $(TOP_DIR)/builds/toplevel.mk
# EOF
# TOP_DIR and OBJ_DIR should be set by the user to the right directories,
# if necessary.
TOP_DIR ?= ../../..
OBJ_DIR ?= $(TOP_DIR)/objs
# The setup below is for gcc on a Unix-like platform.
SRC_DIR = $(TOP_DIR)/src/tools/ftrandom
CC = gcc
WFLAGS = -Wmissing-prototypes \
-Wunused \
-Wimplicit \
-Wreturn-type \
-Wparentheses \
-pedantic \
-Wformat \
-Wchar-subscripts \
-Wsequence-point
CFLAGS = $(WFLAGS) \
-g \
-I $(TOP_DIR)/include
LIBS = -lm \
-L $(OBJ_DIR) \
-lfreetype \
-lz
all: $(OBJ_DIR)/ftrandom
$(OBJ_DIR)/ftrandom: $(SRC_DIR)/ftrandom.c $(OBJ_DIR)/libfreetype.a
$(CC) -o $(OBJ_DIR)/ftrandom $(CFLAGS) $(SRC_DIR)/ftrandom.c $(LIBS)
# EOF
This diff is collapsed.
This diff is collapsed.
# Copyright (c) 2007, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Author: Alfred Peng
CC=cc
CXX=CC
CPPFLAGS=-g -I../../.. -DNDEBUG -features=extensions -D_REENTRANT
LDFLAGS=-lpthread -lssl -lgnutls-openssl -lelf
OBJ_DIR=.
BIN_DIR=.
THREAD_SRC=solaris_lwp.cc
SHARE_SRC=../../minidump_file_writer.cc\
../../../common/md5.c\
../../../common/string_conversion.cc\
../../../common/solaris/file_id.cc\
minidump_generator.cc
HANDLER_SRC=exception_handler.cc\
../../../common/solaris/guid_creator.cc
SHARE_C_SRC=../../../common/convert_UTF.c
MINIDUMP_TEST_SRC=minidump_test.cc
EXCEPTION_TEST_SRC=exception_handler_test.cc
THREAD_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o,$(THREAD_SRC))
SHARE_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o,$(SHARE_SRC))
HANDLER_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o,$(HANDLER_SRC))
SHARE_C_OBJ=$(patsubst %.c,$(OBJ_DIR)/%.o,$(SHARE_C_SRC))
MINIDUMP_TEST_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o, $(MINIDUMP_TEST_SRC))\
$(THREAD_OBJ) $(SHARE_OBJ) $(SHARE_C_OBJ) $(HANDLER_OBJ)
EXCEPTION_TEST_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o, $(EXCEPTION_TEST_SRC))\
$(THREAD_OBJ) $(SHARE_OBJ) $(SHARE_C_OBJ) $(HANDLER_OBJ)
BIN=$(BIN_DIR)/minidump_test\
$(BIN_DIR)/exception_handler_test
.PHONY:all clean
all:$(BIN)
$(BIN_DIR)/minidump_test:$(MINIDUMP_TEST_OBJ)
$(CXX) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
$(BIN_DIR)/exception_handler_test:$(EXCEPTION_TEST_OBJ)
$(CXX) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
clean:
rm -f $(BIN) *.o *.out *.dmp core ../../minidump_file_writer.o\
../../../common/*.o ../../../common/solaris/*.o
# Nonstandard package files for distribution.
EXTRA_DIST =
# We may need to build our internally packaged gtest. If so, it will be
# included in the 'subdirs' variable.
SUBDIRS = $(subdirs)
# Scripts and utilities to be installed by 'make install'.
dist_bin_SCRIPTS = scripts/gmock_doctor.py
bin_SCRIPTS = scripts/gmock-config
# This is generated by the configure script, so clean it for distribution.
DISTCLEANFILES = scripts/gmock-config
# We define the global AM_CPPFLAGS as everything we compile includes from these
# directories.
AM_CPPFLAGS = $(GTEST_CPPFLAGS) -I$(srcdir)/include
# Build rules for libraries.
lib_LTLIBRARIES = lib/libgmock.la lib/libgmock_main.la
lib_libgmock_la_SOURCES = src/gmock.cc \
src/gmock-cardinalities.cc \
src/gmock-internal-utils.cc \
src/gmock-matchers.cc \
src/gmock-printers.cc \
src/gmock-spec-builders.cc
pkginclude_HEADERS = include/gmock/gmock.h \
include/gmock/gmock-actions.h \
include/gmock/gmock-cardinalities.h \
include/gmock/gmock-generated-actions.h \
include/gmock/gmock-generated-function-mockers.h \
include/gmock/gmock-generated-matchers.h \
include/gmock/gmock-generated-nice-strict.h \
include/gmock/gmock-matchers.h \
include/gmock/gmock-printers.h \
include/gmock/gmock-spec-builders.h
pkginclude_internaldir = $(pkgincludedir)/internal
pkginclude_internal_HEADERS = \
include/gmock/internal/gmock-generated-internal-utils.h \
include/gmock/internal/gmock-internal-utils.h \
include/gmock/internal/gmock-port.h
lib_libgmock_main_la_SOURCES = src/gmock_main.cc
lib_libgmock_main_la_LIBADD = lib/libgmock.la
# Build rules for tests. Automake's naming for some of these variables isn't
# terribly obvious, so this is a brief reference:
#
# TESTS -- Programs run automatically by "make check"
# check_PROGRAMS -- Programs built by "make check" but not necessarily run
TESTS=
TESTS_ENVIRONMENT = GMOCK_SOURCE_DIR="$(srcdir)/test" \
GMOCK_BUILD_DIR="$(top_builddir)/test"
check_PROGRAMS=
AM_LDFLAGS = $(GTEST_LDFLAGS)
TESTS += test/gmock-actions_test
check_PROGRAMS += test/gmock-actions_test
test_gmock_actions_test_SOURCES = test/gmock-actions_test.cc
test_gmock_actions_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la
TESTS += test/gmock-cardinalities_test
check_PROGRAMS += test/gmock-cardinalities_test
test_gmock_cardinalities_test_SOURCES = test/gmock-cardinalities_test.cc
test_gmock_cardinalities_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la
TESTS += test/gmock-generated-actions_test
check_PROGRAMS += test/gmock-generated-actions_test
test_gmock_generated_actions_test_SOURCES = test/gmock-generated-actions_test.cc
test_gmock_generated_actions_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la
TESTS += test/gmock-generated-function-mockers_test
check_PROGRAMS += test/gmock-generated-function-mockers_test
test_gmock_generated_function_mockers_test_SOURCES = \
test/gmock-generated-function-mockers_test.cc
test_gmock_generated_function_mockers_test_LDADD = $(GTEST_LIBS) \
lib/libgmock_main.la
TESTS += test/gmock-generated-internal-utils_test
check_PROGRAMS += test/gmock-generated-internal-utils_test
test_gmock_generated_internal_utils_test_SOURCES = \
test/gmock-generated-internal-utils_test.cc
test_gmock_generated_internal_utils_test_LDADD = $(GTEST_LIBS) \
lib/libgmock_main.la
TESTS += test/gmock-generated-matchers_test
check_PROGRAMS += test/gmock-generated-matchers_test
test_gmock_generated_matchers_test_SOURCES = \
test/gmock-generated-matchers_test.cc
test_gmock_generated_matchers_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la
TESTS += test/gmock-internal-utils_test
check_PROGRAMS += test/gmock-internal-utils_test
test_gmock_internal_utils_test_SOURCES = test/gmock-internal-utils_test.cc
test_gmock_internal_utils_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la
TESTS += test/gmock_link_test
check_PROGRAMS += test/gmock_link_test
test_gmock_link_test_SOURCES = test/gmock_link_test.cc \
test/gmock_link2_test.cc \
test/gmock_link_test.h
test_gmock_link_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la
TESTS += test/gmock-matchers_test
check_PROGRAMS += test/gmock-matchers_test
test_gmock_matchers_test_SOURCES = test/gmock-matchers_test.cc
test_gmock_matchers_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la
TESTS += test/gmock-nice-strict_test
check_PROGRAMS += test/gmock-nice-strict_test
test_gmock_nice_strict_test_SOURCES = test/gmock-nice-strict_test.cc
test_gmock_nice_strict_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la
TESTS += test/gmock-port_test
check_PROGRAMS += test/gmock-port_test
test_gmock_port_test_SOURCES = test/gmock-port_test.cc
test_gmock_port_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la
TESTS += test/gmock-printers_test
check_PROGRAMS += test/gmock-printers_test
test_gmock_printers_test_SOURCES = test/gmock-printers_test.cc
test_gmock_printers_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la
TESTS += test/gmock-spec-builders_test
check_PROGRAMS += test/gmock-spec-builders_test
test_gmock_spec_builders_test_SOURCES = test/gmock-spec-builders_test.cc
test_gmock_spec_builders_test_LDADD = $(GTEST_LIBS) lib/libgmock.la
TESTS += test/gmock_test
check_PROGRAMS += test/gmock_test
test_gmock_test_SOURCES = test/gmock_test.cc
test_gmock_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la
# A sanity test for verifying that Google Mock works when RTTI is
# disabled. We pick gmock-spec-builders_test.cc as it exercises all
# components of Google Mock.
TESTS += test/gmock_no_rtti_test
check_PROGRAMS += test/gmock_no_rtti_test
test_gmock_no_rtti_test_SOURCES = test/gmock-spec-builders_test.cc \
src/gmock-all.cc
test_gmock_no_rtti_test_CXXFLAGS = $(AM_CXXFLAGS) -fno-rtti -DGTEST_HAS_RTTI=0
test_gmock_no_rtti_test_LDADD = $(GTEST_LIBS)
# A sanity test for verifying that Google Mock works with Google
# Test's TR1 tuple implementation. We pick
# gmock-spec-builders_test.cc as it exercises all components of Google
# Mock.
TESTS += test/gmock_use_own_tuple_test
check_PROGRAMS += test/gmock_use_own_tuple_test
test_gmock_use_own_tuple_test_SOURCES = test/gmock-spec-builders_test.cc \
src/gmock-all.cc
test_gmock_use_own_tuple_test_CXXFLAGS = \
$(AM_CXXFLAGS) -DGTEST_USE_OWN_TR1_TUPLE=1
test_gmock_use_own_tuple_test_LDADD = $(GTEST_LIBS)
# The following tests depend on the presence of a Python installation and are
# keyed off of it. We only add them to the TESTS variable when a Python
# interpreter is available. TODO(chandlerc@google.com): While we currently only
# attempt to build and execute these tests if Autoconf has found Python v2.3 on
# the system, we don't use the PYTHON variable it specified as the valid
# interpreter. The problem is that TESTS_ENVIRONMENT is a global variable, and
# thus we cannot distinguish between C++ unit tests and Python unit tests.
dist_check_SCRIPTS =
# Python modules used by multiple Python tests below.
dist_check_SCRIPTS += test/gmock_test_utils.py
check_PROGRAMS += test/gmock_leak_test_
test_gmock_leak_test__SOURCES = test/gmock_leak_test_.cc
test_gmock_leak_test__LDADD = $(GTEST_LIBS) lib/libgmock_main.la
dist_check_SCRIPTS += test/gmock_leak_test.py
check_PROGRAMS += test/gmock_output_test_
test_gmock_output_test__SOURCES = test/gmock_output_test_.cc
test_gmock_output_test__LDADD = $(GTEST_LIBS) lib/libgmock_main.la
dist_check_SCRIPTS += test/gmock_output_test.py
EXTRA_DIST += test/gmock_output_test_golden.txt
# Enable all the python driven tests when we can run them.
if HAVE_PYTHON
TESTS += \
test/gmock_leak_test.py \
test/gmock_output_test.py
endif
# Nonstandard package files for distribution.
EXTRA_DIST += \
CHANGES \
CONTRIBUTORS \
make/Makefile \
src/gmock-all.cc
# Pump scripts for generating Google Mock headers.
# TODO(chandlerc@google.com): automate the generation of *.h from *.h.pump.
EXTRA_DIST += include/gmock/gmock-generated-actions.h.pump \
include/gmock/gmock-generated-function-mockers.h.pump \
include/gmock/gmock-generated-matchers.h.pump \
include/gmock/gmock-generated-nice-strict.h.pump \
include/gmock/internal/gmock-generated-internal-utils.h.pump
# Script for fusing Google Mock and Google Test source files.
EXTRA_DIST += \
scripts/fuse_gmock_files.py \
scripts/test/Makefile
# The Google Mock Generator tool from the cppclean project.
EXTRA_DIST += \
scripts/generator/COPYING \
scripts/generator/README \
scripts/generator/README.cppclean \
scripts/generator/cpp/__init__.py \
scripts/generator/cpp/ast.py \
scripts/generator/cpp/gmock_class.py \
scripts/generator/cpp/keywords.py \
scripts/generator/cpp/tokenize.py \
scripts/generator/cpp/utils.py \
scripts/generator/gmock_gen.py
# Microsoft Visual Studio 2005 projects.
EXTRA_DIST += \
msvc/gmock.sln \
msvc/gmock.vcproj \
msvc/gmock_config.vsprops \
msvc/gmock_link_test.vcproj \
msvc/gmock_main.vcproj \
msvc/gmock_output_test_.vcproj \
msvc/gmock-spec-builders_test.vcproj \
msvc/gmock_test.vcproj
# A sample Makefile for building Google Test and using it in user
# tests. Please tweak it to suit your environment and project. You
# may want to move it to your project's root directory.
#
# SYNOPSIS:
#
# make [all] - makes everything.
# make TARGET - makes the given target.
# make clean - removes all files generated by make.
# Please tweak the following variable definitions as needed by your
# project, except GTEST_HEADERS, which you can use in your own targets
# but shouldn't modify.
# Points to the root of Google Test, relative to where this file is.
# Remember to tweak this if you move this file.
GTEST_DIR = ..
# Where to find user code.
USER_DIR = ../samples
# Flags passed to the preprocessor.
CPPFLAGS += -I$(GTEST_DIR) -I$(GTEST_DIR)/include
# Flags passed to the C++ compiler.
CXXFLAGS += -g -Wall -Wextra
# All tests produced by this Makefile. Remember to add new tests you
# created to the list.
TESTS = sample1_unittest
# All Google Test headers. Usually you shouldn't change this
# definition.
GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \
$(GTEST_DIR)/include/gtest/internal/*.h
# House-keeping build targets.
all : $(TESTS)
clean :
rm -f $(TESTS) gtest.a gtest_main.a *.o
# Builds gtest.a and gtest_main.a.
# Usually you shouldn't tweak such internal variables, indicated by a
# trailing _.
GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS)
# For simplicity and to avoid depending on Google Test's
# implementation details, the dependencies specified below are
# conservative and not optimized. This is fine as Google Test
# compiles fast and for ordinary users its source rarely changes.
gtest-all.o : $(GTEST_SRCS_)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GTEST_DIR)/src/gtest-all.cc
gtest_main.o : $(GTEST_SRCS_)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GTEST_DIR)/src/gtest_main.cc
gtest.a : gtest-all.o
$(AR) $(ARFLAGS) $@ $^
gtest_main.a : gtest-all.o gtest_main.o
$(AR) $(ARFLAGS) $@ $^
# Builds a sample test. A test should link with either gtest.a or
# gtest_main.a, depending on whether it defines its own main()
# function.
sample1.o : $(USER_DIR)/sample1.cc $(USER_DIR)/sample1.h $(GTEST_HEADERS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/sample1.cc
sample1_unittest.o : $(USER_DIR)/sample1_unittest.cc \
$(USER_DIR)/sample1.h $(GTEST_HEADERS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/sample1_unittest.cc
sample1_unittest : sample1.o sample1_unittest.o gtest_main.a
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@
# A Makefile for fusing Google Test and building a sample test against it.
#
# SYNOPSIS:
#
# make [all] - makes everything.
# make TARGET - makes the given target.
# make check - makes everything and runs the built sample test.
# make clean - removes all files generated by make.
# Points to the root of fused Google Test, relative to where this file is.
FUSED_GTEST_DIR = output
# Paths to the fused gtest files.
FUSED_GTEST_H = $(FUSED_GTEST_DIR)/gtest/gtest.h
FUSED_GTEST_ALL_CC = $(FUSED_GTEST_DIR)/gtest/gtest-all.cc
# Where to find the sample test.
SAMPLE_DIR = ../../samples
# Where to find gtest_main.cc.
GTEST_MAIN_CC = ../../src/gtest_main.cc
# Flags passed to the preprocessor.
CPPFLAGS += -I$(FUSED_GTEST_DIR)
# Flags passed to the C++ compiler.
CXXFLAGS += -g
all : sample1_unittest
check : all
./sample1_unittest
clean :
rm -rf $(FUSED_GTEST_DIR) sample1_unittest *.o
$(FUSED_GTEST_H) :
../fuse_gtest_files.py $(FUSED_GTEST_DIR)
$(FUSED_GTEST_ALL_CC) :
../fuse_gtest_files.py $(FUSED_GTEST_DIR)
gtest-all.o : $(FUSED_GTEST_H) $(FUSED_GTEST_ALL_CC)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(FUSED_GTEST_DIR)/gtest/gtest-all.cc
gtest_main.o : $(FUSED_GTEST_H) $(GTEST_MAIN_CC)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GTEST_MAIN_CC)
sample1.o : $(SAMPLE_DIR)/sample1.cc $(SAMPLE_DIR)/sample1.h
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SAMPLE_DIR)/sample1.cc
sample1_unittest.o : $(SAMPLE_DIR)/sample1_unittest.cc \
$(SAMPLE_DIR)/sample1.h $(FUSED_GTEST_H)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SAMPLE_DIR)/sample1_unittest.cc
sample1_unittest : sample1.o sample1_unittest.o gtest-all.o gtest_main.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@
# A sample Makefile for building both Google Mock and Google Test and
# using them in user tests. This file is self-contained, so you don't
# need to use the Makefile in Google Test's source tree. Please tweak
# it to suit your environment and project. You may want to move it to
# your project's root directory.
#
# SYNOPSIS:
#
# make [all] - makes everything.
# make TARGET - makes the given target.
# make clean - removes all files generated by make.
# Please tweak the following variable definitions as needed by your
# project, except GMOCK_HEADERS and GTEST_HEADERS, which you can use
# in your own targets but shouldn't modify.
# Points to the root of Google Test, relative to where this file is.
# Remember to tweak this if you move this file, or if you want to use
# a copy of Google Test at a different location.
GTEST_DIR = ../gtest
# Points to the root of Google Mock, relative to where this file is.
# Remember to tweak this if you move this file.
GMOCK_DIR = ..
# Where to find user code.
USER_DIR = ../test
# Flags passed to the preprocessor.
CPPFLAGS += -I$(GMOCK_DIR) -I$(GMOCK_DIR)/include \
-I$(GTEST_DIR) -I$(GTEST_DIR)/include
# Flags passed to the C++ compiler.
CXXFLAGS += -g -Wall -Wextra
# All tests produced by this Makefile. Remember to add new tests you
# created to the list.
TESTS = gmock_link_test gmock_test
# All Google Test headers. Usually you shouldn't change this
# definition.
GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \
$(GTEST_DIR)/include/gtest/internal/*.h
# All Google Mock headers. Note that all Google Test headers are
# included here too, as they are #included by Google Mock headers.
# Usually you shouldn't change this definition.
GMOCK_HEADERS = $(GMOCK_DIR)/include/gmock/*.h \
$(GMOCK_DIR)/include/gmock/internal/*.h \
$(GTEST_HEADERS)
# House-keeping build targets.
all : $(TESTS)
clean :
rm -f $(TESTS) gmock.a gmock_main.a *.o
# Builds gmock.a and gmock_main.a. These libraries contain both
# Google Mock and Google Test. A test should link with either gmock.a
# or gmock_main.a, depending on whether it defines its own main()
# function. It's fine if your test only uses features from Google
# Test (and not Google Mock).
# Usually you shouldn't tweak such internal variables, indicated by a
# trailing _.
GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS)
GMOCK_SRCS_ = $(GMOCK_DIR)/src/*.cc $(GMOCK_HEADERS)
# For simplicity and to avoid depending on implementation details of
# Google Mock and Google Test, the dependencies specified below are
# conservative and not optimized. This is fine as Google Mock and
# Google Test compile fast and for ordinary users their source rarely
# changes.
gtest-all.o : $(GTEST_SRCS_)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GTEST_DIR)/src/gtest-all.cc
gmock-all.o : $(GMOCK_SRCS_)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GMOCK_DIR)/src/gmock-all.cc
gmock_main.o : $(GMOCK_SRCS_)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GMOCK_DIR)/src/gmock_main.cc
gmock.a : gmock-all.o gtest-all.o
$(AR) $(ARFLAGS) $@ $^
gmock_main.a : gmock-all.o gtest-all.o gmock_main.o
$(AR) $(ARFLAGS) $@ $^
# Builds a sample test.
gmock_link_test.o : $(USER_DIR)/gmock_link_test.cc \
$(USER_DIR)/gmock_link_test.h $(GMOCK_HEADERS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/gmock_link_test.cc
gmock_link2_test.o : $(USER_DIR)/gmock_link2_test.cc \
$(USER_DIR)/gmock_link_test.h $(GMOCK_HEADERS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/gmock_link2_test.cc
gmock_link_test : gmock_link_test.o gmock_link2_test.o gmock_main.a
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@
# Builds another sample test.
gmock_test.o : $(USER_DIR)/gmock_test.cc $(GMOCK_HEADERS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/gmock_test.cc
gmock_test : gmock_test.o gmock_main.a
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@
# A Makefile for fusing Google Mock and building a sample test against it.
#
# SYNOPSIS:
#
# make [all] - makes everything.
# make TARGET - makes the given target.
# make check - makes everything and runs the built sample test.
# make clean - removes all files generated by make.
# Points to the root of fused Google Mock, relative to where this file is.
FUSED_GMOCK_DIR = output
# Paths to the fused gmock files.
FUSED_GTEST_H = $(FUSED_GMOCK_DIR)/gtest/gtest.h
FUSED_GMOCK_H = $(FUSED_GMOCK_DIR)/gmock/gmock.h
FUSED_GMOCK_GTEST_ALL_CC = $(FUSED_GMOCK_DIR)/gmock-gtest-all.cc
# Where to find the gmock_test.cc.
GMOCK_TEST_CC = ../../test/gmock_test.cc
# Where to find gmock_main.cc.
GMOCK_MAIN_CC = ../../src/gmock_main.cc
# Flags passed to the preprocessor.
CPPFLAGS += -I$(FUSED_GMOCK_DIR)
# Flags passed to the C++ compiler.
CXXFLAGS += -g
all : gmock_test
check : all
./gmock_test
clean :
rm -rf $(FUSED_GMOCK_DIR) gmock_test *.o
$(FUSED_GTEST_H) :
../fuse_gmock_files.py $(FUSED_GMOCK_DIR)
$(FUSED_GMOCK_H) :
../fuse_gmock_files.py $(FUSED_GMOCK_DIR)
$(FUSED_GMOCK_GTEST_ALL_CC) :
../fuse_gmock_files.py $(FUSED_GMOCK_DIR)
gmock-gtest-all.o : $(FUSED_GTEST_H) $(FUSED_GMOCK_H) $(FUSED_GMOCK_GTEST_ALL_CC)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(FUSED_GMOCK_GTEST_ALL_CC)
gmock_main.o : $(FUSED_GTEST_H) $(FUSED_GMOCK_H) $(GMOCK_MAIN_CC)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GMOCK_MAIN_CC)
gmock_test.o : $(FUSED_GTEST_H) $(FUSED_GMOCK_H) $(GMOCK_TEST_CC)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GMOCK_TEST_CC)
gmock_test : gmock_test.o gmock-gtest-all.o gmock_main.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@
include_HEADERS = libdis.h
lib_LTLIBRARIES = libdisasm.la
libdisasm_la_SOURCES = \
ia32_implicit.c \
ia32_implicit.h \
ia32_insn.c \
ia32_insn.h \
ia32_invariant.c \
ia32_invariant.h \
ia32_modrm.c \
ia32_modrm.h \
ia32_opcode_tables.c \
ia32_opcode_tables.h \
ia32_operand.c \
ia32_operand.h \
ia32_reg.c \
ia32_reg.h \
ia32_settings.c \
ia32_settings.h \
libdis.h \
qword.h \
x86_disasm.c \
x86_format.c \
x86_imm.c \
x86_imm.h \
x86_insn.c \
x86_misc.c \
x86_operand_list.c \
x86_operand_list.h
# Cheat to get non-autoconf swig into tarball,
# even if it doesn't build by default.
EXTRA_DIST = \
swig/Makefile \
swig/libdisasm.i \
swig/libdisasm_oop.i \
swig/python/Makefile-swig \
swig/perl/Makefile-swig \
swig/perl/Makefile.PL \
swig/ruby/Makefile-swig \
swig/ruby/extconf.rb \
swig/tcl/Makefile-swig \
swig/README
# change these values if you need to
SWIG = swig # apt-get install swig !
GCC = gcc
CC_FLAGS = -c -fPIC
LD_FLAGS = -shared -L../.. -ldisasm
BASE_NAME = x86disasm
export INTERFACE_FILE BASE_NAME SWIG GCC CC_FLAGS LD_FLAGS
#====================================================
# TARGETS
all: swig
dummy: swig swig-python swig-ruby swig-perl swig-tcl install uninstall clean
swig: swig-python swig-perl
# swig-rub swig-tcl
swig-python:
cd python && make -f Makefile-swig
swig-ruby:
cd ruby && make -f Makefile-swig
swig-perl:
cd perl && make -f Makefile-swig
swig-tcl:
cd tcl && make -f Makefile-swig
# ==================================================================
install: install-python install-perl
# install-ruby install-tcl
install-python:
cd python && sudo make -f Makefile-swig install
install-ruby:
cd ruby && sudo make -f Makefile-swig install
install-perl:
cd perl && sudo make -f Makefile-swig install
install-tcl:
cd tcl && sudo make -f Makefile-swig install
# ==================================================================
uninstall: uninstall-python
#uninstall-ruby uninstall-perl uninstall-tcl
uninstall-python:
cd python && sudo make -f Makefile-swig uninstall
uninstall-ruby:
cd ruby && sudo make -f Makefile-swig uninstall
uninstall-perl:
cd perl && sudo make -f Makefile-swig uninstall
uninstall-tcl:
cd tcl && sudo make -f Makefile-swig uninstall
# ==================================================================
clean:
cd python && make -f Makefile-swig clean
cd ruby && make -f Makefile-swig clean
cd perl && make -f Makefile-swig clean
cd tcl && make -f Makefile-swig clean
ifndef BASE_NAME
BASE_NAME = x86disasm
endif
ifndef SWIG
SWIG = swig # apt-get install swig !
endif
ifndef GCC
GCC = gcc
endif
ifndef CC_FLAGS
CC_FLAGS = -c -fPIC
endif
ifndef LD_FLAGS
LD_FLAGS = -shared -L.. -ldisasm
endif
INTERFACE_FILE = libdisasm_oop.i
SWIG_INTERFACE = ../$(INTERFACE_FILE)
# PERL rules
PERL_MOD = blib/arch/auto/$(BASE_NAME)/$(BASE_NAME).so
PERL_SHADOW = $(BASE_NAME)_wrap.c
PERL_SWIG = $(BASE_NAME).pl
PERL_OBJ = $(BASE_NAME)_wrap.o
PERL_INC = `perl -e 'use Config; print $$Config{archlib};'`/CORE
PERL_CC_FLAGS = `perl -e 'use Config; print $$Config{ccflags};'`
#====================================================
# TARGETS
all: swig-perl
dummy: swig-perl install uninstall clean
swig-perl: $(PERL_MOD)
$(PERL_MOD): $(PERL_OBJ)
perl Makefile.PL
make
#$(GCC) $(LD_FLAGS) $(PERL_OBJ) -o $@
$(PERL_OBJ): $(PERL_SHADOW)
$(GCC) $(CC_FLAGS) $(PERL_CC_FLAGS) -I$(PERL_INC) -o $@ $<
$(PERL_SHADOW): $(SWIG_INTERFACE)
swig -perl -shadow -o $(PERL_SHADOW) -outdir . $<
# ==================================================================
install: $(PERL_MOD)
make install
# ==================================================================
uninstall:
# ==================================================================
clean:
rm $(PERL_MOD) $(PERL_OBJ)
rm $(PERL_SHADOW)
rm -rf Makefile blib pm_to_blib
use ExtUtils::MakeMaker;
WriteMakefile(
'NAME' => 'x86disasm',
'LIBS' => ['-ldisasm'],
'OBJECT' => 'x86disasm_wrap.o'
);
ifndef BASE_NAME
BASE_NAME = x86disasm
endif
ifndef SWIG
SWIG = swig # apt-get install swig !
endif
ifndef GCC
GCC = gcc
endif
ifndef CC_FLAGS
CC_FLAGS = -c -fPIC
endif
ifndef LD_FLAGS
LD_FLAGS = -shared -L.. -ldisasm
endif
INTERFACE_FILE = libdisasm_oop.i
SWIG_INTERFACE = ../$(INTERFACE_FILE)
# PYTHON rules
PYTHON_MOD = $(BASE_NAME)-python.so
PYTHON_SHADOW = $(BASE_NAME)_wrap.c
PYTHON_SWIG = $(BASE_NAME).py
PYTHON_OBJ = $(BASE_NAME)_wrap.o
PYTHON_INC = `/bin/echo -e 'import sys\nprint sys.prefix + "/include/python" + sys.version[:3]' | python`
PYTHON_LIB = `/bin/echo -e 'import sys\nprint sys.prefix + "/lib/python" + sys.version[:3]' | python`
PYTHON_DEST = $(PYTHON_LIB)/lib-dynload/_$(BASE_NAME).so
#====================================================
# TARGETS
all: swig-python
dummy: swig-python install uninstall clean
swig-python: $(PYTHON_MOD)
$(PYTHON_MOD): $(PYTHON_OBJ)
$(GCC) $(LD_FLAGS) $(PYTHON_OBJ) -o $@
$(PYTHON_OBJ): $(PYTHON_SHADOW)
$(GCC) $(CC_FLAGS) -I$(PYTHON_INC) -I.. -o $@ $<
$(PYTHON_SHADOW): $(SWIG_INTERFACE)
swig -python -shadow -o $(PYTHON_SHADOW) -outdir . $<
# ==================================================================
install: $(PYTHON_MOD)
sudo cp $(PYTHON_MOD) $(PYTHON_DEST)
sudo cp $(PYTHON_SWIG) $(PYTHON_LIB)
# ==================================================================
uninstall:
# ==================================================================
clean:
rm $(PYTHON_MOD) $(PYTHON_SWIG) $(PYTHON_OBJ)
rm $(PYTHON_SHADOW)
ifndef BASE_NAME
BASE_NAME = x86disasm
endif
ifndef SWIG
SWIG = swig # apt-get install swig !
endif
ifndef GCC
GCC = gcc
endif
ifndef CC_FLAGS
CC_FLAGS = -c -fPIC
endif
ifndef LD_FLAGS
LD_FLAGS = -shared -L../.. -ldisasm
endif
LIBDISASM_DIR = ../..
INTERFACE_FILE = libdisasm_oop.i
SWIG_INTERFACE = ../$(INTERFACE_FILE)
# RUBY rules
RUBY_MAKEFILE = Makefile
RUBY_MOD = $(BASE_NAME).so
RUBY_SHADOW = $(BASE_NAME)_wrap.c
#RUBY_SWIG = $(BASE_NAME).rb
RUBY_OBJ = $(BASE_NAME)_wrap.o
RUBY_INC = `ruby -e 'puts $$:.join("\n")' | tail -2 | head -1`
#RUBY_LIB =
#RUBY_DEST =
#====================================================
# TARGETS
all: swig-ruby
dummy: swig-ruby install uninstall clean
swig-ruby: $(RUBY_MOD)
$(RUBY_MOD): $(RUBY_MAKEFILE)
make
$(RUBY_MAKEFILE): $(RUBY_OBJ)
ruby extconf.rb
$(RUBY_OBJ):$(RUBY_SHADOW)
$(GCC) $(CC_FLAGS) -I$(RUBY_INC) -I.. -o $@ $<
$(RUBY_SHADOW): $(SWIG_INTERFACE)
swig -ruby -o $(RUBY_SHADOW) -outdir . $<
# ==================================================================
install: $(RUBY_MOD)
make install
# ==================================================================
uninstall:
# ==================================================================
clean:
make clean || true
rm $(RUBY_SHADOW) $(RUBY_MAKEFILE) $(RUBY_MOD) $(RUBY_OBJ)
ifndef BASE_NAME
BASE_NAME = x86disasm
endif
ifndef SWIG
SWIG = swig # apt-get install swig !
endif
ifndef GCC
GCC = gcc
endif
ifndef CC_FLAGS
CC_FLAGS = -c -fPIC
endif
ifndef LD_FLAGS
LD_FLAGS = -shared -L../.. -ldisasm
endif
INTERFACE_FILE = libdisasm.i
SWIG_INTERFACE = ../$(INTERFACE_FILE)
# TCL rules
TCL_VERSION = 8.3
TCL_MOD = $(BASE_NAME)-tcl.so
TCL_SHADOW = $(BASE_NAME)_wrap.c
TCL_OBJ = $(BASE_NAME)_wrap.o
TCL_INC = /usr/include/tcl$(TCL_VERSION)
TCL_LIB = /usr/lib/tcl$(TCL_VERSION)
TCL_DEST = $(TCL_LIB)/$(BASE_NAME).so
#====================================================
# TARGETS
all: swig-tcl
dummy: swig-tcl install uninstall clean
swig-tcl: $(TCL_MOD)
$(TCL_MOD): $(TCL_OBJ)
$(GCC) $(LD_FLAGS) $(TCL_OBJ) -o $@
$(TCL_OBJ): $(TCL_SHADOW)
$(GCC) $(CC_FLAGS) -I$(TCL_INC) -I.. -o $@ $<
$(TCL_SHADOW): $(SWIG_INTERFACE)
swig -tcl -o $(TCL_SHADOW) -outdir . $<
# ==================================================================
install: $(TCL_MOD)
sudo cp $(TCL_MOD) $(TCL_DEST)
# ==================================================================
uninstall:
# ==================================================================
clean:
rm $(TCL_MOD) $(TCL_SWIG) $(TCL_OBJ)
rm $(TCL_SHADOW)
# See README.txt.
.PHONY: all cpp java python clean
all: cpp java python
cpp: add_person_cpp list_people_cpp
java: add_person_java list_people_java
python: add_person_python list_people_python
clean:
rm -f add_person_cpp list_people_cpp add_person_java list_people_java add_person_python list_people_python
rm -f javac_middleman AddPerson*.class ListPeople*.class com/example/tutorial/*.class
rm -f protoc_middleman addressbook.pb.cc addressbook.pb.h addressbook_pb2.py com/example/tutorial/AddressBookProtos.java
rm -f *.pyc
rmdir com/example/tutorial 2>/dev/null || true
rmdir com/example 2>/dev/null || true
rmdir com 2>/dev/null || true
protoc_middleman: addressbook.proto
protoc --cpp_out=. --java_out=. --python_out=. addressbook.proto
@touch protoc_middleman
add_person_cpp: add_person.cc protoc_middleman
pkg-config --cflags protobuf # fails if protobuf is not installed
c++ add_person.cc addressbook.pb.cc -o add_person_cpp `pkg-config --cflags --libs protobuf`
list_people_cpp: list_people.cc protoc_middleman
pkg-config --cflags protobuf # fails if protobuf is not installed
c++ list_people.cc addressbook.pb.cc -o list_people_cpp `pkg-config --cflags --libs protobuf`
javac_middleman: AddPerson.java ListPeople.java protoc_middleman
javac AddPerson.java ListPeople.java com/example/tutorial/AddressBookProtos.java
@touch javac_middleman
add_person_java: javac_middleman
@echo "Writing shortcut script add_person_java..."
@echo '#! /bin/sh' > add_person_java
@echo 'java -classpath .:$$CLASSPATH AddPerson "$$@"' >> add_person_java
@chmod +x add_person_java
list_people_java: javac_middleman
@echo "Writing shortcut script list_people_java..."
@echo '#! /bin/sh' > list_people_java
@echo 'java -classpath .:$$CLASSPATH ListPeople "$$@"' >> list_people_java
@chmod +x list_people_java
add_person_python: add_person.py protoc_middleman
@echo "Writing shortcut script add_person_python..."
@echo '#! /bin/sh' > add_person_python
@echo './add_person.py "$$@"' >> add_person_python
@chmod +x add_person_python
list_people_python: list_people.py protoc_middleman
@echo "Writing shortcut script list_people_python..."
@echo '#! /bin/sh' > list_people_python
@echo './list_people.py "$$@"' >> list_people_python
@chmod +x list_people_python
# A sample Makefile for building Google Test and using it in user
# tests. Please tweak it to suit your environment and project. You
# may want to move it to your project's root directory.
#
# SYNOPSIS:
#
# make [all] - makes everything.
# make TARGET - makes the given target.
# make clean - removes all files generated by make.
# Please tweak the following variable definitions as needed by your
# project, except GTEST_HEADERS, which you can use in your own targets
# but shouldn't modify.
# Points to the root of Google Test, relative to where this file is.
# Remember to tweak this if you move this file.
GTEST_DIR = ..
# Where to find user code.
USER_DIR = ../samples
# Flags passed to the preprocessor.
CPPFLAGS += -I$(GTEST_DIR) -I$(GTEST_DIR)/include
# Flags passed to the C++ compiler.
CXXFLAGS += -g -Wall -Wextra
# All tests produced by this Makefile. Remember to add new tests you
# created to the list.
TESTS = sample1_unittest
# All Google Test headers. Usually you shouldn't change this
# definition.
GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \
$(GTEST_DIR)/include/gtest/internal/*.h
# House-keeping build targets.
all : $(TESTS)
clean :
rm -f $(TESTS) gtest.a gtest_main.a *.o
# Builds gtest.a and gtest_main.a.
# Usually you shouldn't tweak such internal variables, indicated by a
# trailing _.
GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS)
# For simplicity and to avoid depending on Google Test's
# implementation details, the dependencies specified below are
# conservative and not optimized. This is fine as Google Test
# compiles fast and for ordinary users its source rarely changes.
gtest-all.o : $(GTEST_SRCS_)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GTEST_DIR)/src/gtest-all.cc
gtest_main.o : $(GTEST_SRCS_)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GTEST_DIR)/src/gtest_main.cc
gtest.a : gtest-all.o
$(AR) $(ARFLAGS) $@ $^
gtest_main.a : gtest-all.o gtest_main.o
$(AR) $(ARFLAGS) $@ $^
# Builds a sample test. A test should link with either gtest.a or
# gtest_main.a, depending on whether it defines its own main()
# function.
sample1.o : $(USER_DIR)/sample1.cc $(USER_DIR)/sample1.h $(GTEST_HEADERS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/sample1.cc
sample1_unittest.o : $(USER_DIR)/sample1_unittest.cc \
$(USER_DIR)/sample1.h $(GTEST_HEADERS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(USER_DIR)/sample1_unittest.cc
sample1_unittest : sample1.o sample1_unittest.o gtest_main.a
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@
# A Makefile for fusing Google Test and building a sample test against it.
#
# SYNOPSIS:
#
# make [all] - makes everything.
# make TARGET - makes the given target.
# make check - makes everything and runs the built sample test.
# make clean - removes all files generated by make.
# Points to the root of fused Google Test, relative to where this file is.
FUSED_GTEST_DIR = output
# Paths to the fused gtest files.
FUSED_GTEST_H = $(FUSED_GTEST_DIR)/gtest/gtest.h
FUSED_GTEST_ALL_CC = $(FUSED_GTEST_DIR)/gtest/gtest-all.cc
# Where to find the sample test.
SAMPLE_DIR = ../../samples
# Where to find gtest_main.cc.
GTEST_MAIN_CC = ../../src/gtest_main.cc
# Flags passed to the preprocessor.
CPPFLAGS += -I$(FUSED_GTEST_DIR)
# Flags passed to the C++ compiler.
CXXFLAGS += -g
all : sample1_unittest
check : all
./sample1_unittest
clean :
rm -rf $(FUSED_GTEST_DIR) sample1_unittest *.o
$(FUSED_GTEST_H) :
../fuse_gtest_files.py $(FUSED_GTEST_DIR)
$(FUSED_GTEST_ALL_CC) :
../fuse_gtest_files.py $(FUSED_GTEST_DIR)
gtest-all.o : $(FUSED_GTEST_H) $(FUSED_GTEST_ALL_CC)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(FUSED_GTEST_DIR)/gtest/gtest-all.cc
gtest_main.o : $(FUSED_GTEST_H) $(GTEST_MAIN_CC)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GTEST_MAIN_CC)
sample1.o : $(SAMPLE_DIR)/sample1.cc $(SAMPLE_DIR)/sample1.h
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SAMPLE_DIR)/sample1.cc
sample1_unittest.o : $(SAMPLE_DIR)/sample1_unittest.cc \
$(SAMPLE_DIR)/sample1.h $(FUSED_GTEST_H)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SAMPLE_DIR)/sample1_unittest.cc
sample1_unittest : sample1.o sample1_unittest.o gtest-all.o gtest_main.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@
# Additional tests to run before releasing a package.
#
# Run like:
# make PACKAGE=/path/to/protobuf-VERSION.tar.gz
#
# Some of these tests require tools or make assumptions that may not be
# available on end-user machines, so these cannot be part of "make check". For
# example, we test that the headers compile with strict warning settings, but
# since different compilers produce wildly different warnings we cannot assume
# that this test will pass everywhere. If we ran it as part of "make check",
# it could unnecessarily block users from running the real tests just because
# their compiler produces some extra warnings that probably aren't a big deal.
# So we run it separately.
all: header_warning_test
clean:
rm -rf src target header_warning_test.cc header_warning_test.o header_warning_test
# Unpack the package into src, then install it into target.
PACKAGE=protobuf.tar.gz
src: $(PACKAGE)
tar zxvf $(PACKAGE)
mv `basename $(PACKAGE) .tar.gz` src
target: src
(cd src && ./configure --prefix=$$PWD/../target --disable-shared)
(cd src && make -j4 check)
(cd src && make install)
# Verify that headers produce no warnings even under strict settings.
header_warning_test.cc: target
( (cd target/include && find google/protobuf -name '*.h') | \
awk '{print "#include \""$$1"\""} ' > header_warning_test.cc )
header_warning_test: header_warning_test.cc
# TODO(kenton): Consider adding -pedantic and -Weffc++. Currently these
# produce tons of extra warnings so we'll need to do some work first.
g++ -Itarget/include -Wall -Werror -Wsign-compare -O2 -c header_warning_test.cc
touch header_warning_test
# Copyright (c) 2007, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Author: Alfred Peng
CXX=CC
CC=cc
CXXFLAGS=-g -xs -xdebugformat=stabs -I../../.. -I../../../common/solaris -lelf -ldemangle -D_REENTRANT
.PHONY:all clean
BIN=dump_syms
all:$(BIN)
DUMP_OBJ=dump_symbols.o guid_creator.o dump_syms.o file_id.o md5.o
dump_syms:$(DUMP_OBJ)
$(CXX) $(CXXFLAGS) -o $@ $^
dump_symbols.o:../../../common/solaris/dump_symbols.cc
$(CXX) $(CXXFLAGS) -c $^
guid_creator.o:../../../common/solaris/guid_creator.cc
$(CXX) $(CXXFLAGS) -c $^
file_id.o:../../../common/solaris/file_id.cc
$(CXX) $(CXXFLAGS) -c $^
md5.o:../../../common/md5.c
$(CC) $(CXXFLAGS) -c $^
test:all
./run_regtest.sh
clean:
rm -f $(BIN) $(DUMP_OBJ)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#
# crypto/aes/Makefile
#
DIR= aes
TOP= ../..
CC= cc
CPP= $(CC) -E
INCLUDES=
CFLAG=-g
MAKEFILE= Makefile
AR= ar r
AES_ENC=aes_core.o aes_cbc.o
CFLAGS= $(INCLUDES) $(CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
GENERAL=Makefile
#TEST=aestest.c
TEST=
APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC=aes_core.c aes_misc.c aes_ecb.c aes_cbc.c aes_cfb.c aes_ofb.c \
aes_ctr.c aes_ige.c aes_wrap.c
LIBOBJ=aes_misc.o aes_ecb.o aes_cfb.o aes_ofb.o aes_ctr.o aes_ige.o aes_wrap.o \
$(AES_ENC)
SRC= $(LIBSRC)
EXHEADER= aes.h
HEADER= aes_locl.h $(EXHEADER)
ALL= $(GENERAL) $(SRC) $(HEADER)
top:
(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
all: lib
lib: $(LIBOBJ)
$(AR) $(LIB) $(LIBOBJ)
$(RANLIB) $(LIB) || echo Never mind.
@touch lib
aes-ia64.s: asm/aes-ia64.S
$(CC) $(CFLAGS) -E asm/aes-ia64.S > $@
aes-586.s: asm/aes-586.pl ../perlasm/x86asm.pl
$(PERL) asm/aes-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
aes-x86_64.s: asm/aes-x86_64.pl
$(PERL) asm/aes-x86_64.pl $(PERLASM_SCHEME) > $@
aes-sparcv9.s: asm/aes-sparcv9.pl
$(PERL) asm/aes-sparcv9.pl $(CFLAGS) > $@
aes-ppc.s: asm/aes-ppc.pl
$(PERL) asm/aes-ppc.pl $(PERLASM_SCHEME) $@
# GNU make "catch all"
aes-%.s: asm/aes-%.pl; $(PERL) $< $(CFLAGS) > $@
files:
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
links:
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
install:
@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
do \
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
done;
tags:
ctags $(SRC)
tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
mv -f Makefile.new $(MAKEFILE)
clean:
rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
aes_cbc.o: ../../include/openssl/aes.h ../../include/openssl/modes.h
aes_cbc.o: ../../include/openssl/opensslconf.h aes_cbc.c
aes_cfb.o: ../../include/openssl/aes.h ../../include/openssl/modes.h
aes_cfb.o: ../../include/openssl/opensslconf.h aes_cfb.c
aes_core.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
aes_core.o: ../../include/openssl/opensslconf.h aes_core.c aes_locl.h
aes_ctr.o: ../../include/openssl/aes.h ../../include/openssl/modes.h
aes_ctr.o: ../../include/openssl/opensslconf.h aes_ctr.c
aes_ecb.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
aes_ecb.o: ../../include/openssl/opensslconf.h aes_ecb.c aes_locl.h
aes_ige.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/bio.h
aes_ige.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
aes_ige.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
aes_ige.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
aes_ige.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
aes_ige.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
aes_ige.o: ../../include/openssl/symhacks.h ../cryptlib.h aes_ige.c aes_locl.h
aes_misc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
aes_misc.o: ../../include/openssl/opensslconf.h
aes_misc.o: ../../include/openssl/opensslv.h aes_locl.h aes_misc.c
aes_ofb.o: ../../include/openssl/aes.h ../../include/openssl/modes.h
aes_ofb.o: ../../include/openssl/opensslconf.h aes_ofb.c
aes_wrap.o: ../../e_os.h ../../include/openssl/aes.h
aes_wrap.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
aes_wrap.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
aes_wrap.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
aes_wrap.o: ../../include/openssl/opensslconf.h
aes_wrap.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
aes_wrap.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
aes_wrap.o: ../../include/openssl/symhacks.h ../cryptlib.h aes_wrap.c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
CFLAGS=-I../../include -Wall -Werror -g
all: state_machine
state_machine: state_machine.o
$(CC) -o state_machine state_machine.o -L../.. -lssl -lcrypto
test: state_machine
./state_machine 10000 ../../apps/server.pem ../../apps/server.pem
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment