From 97af80b6141bec3f6bd02e695594108bf70252e1 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 10 Dec 2014 22:14:06 -0500 Subject: [PATCH] Fix build. --- .gitignore | 10 +- CMakeLists.txt | 9 - CMakeModules/UseHaiku.cmake | 151 ------ Source/CMakeLists.txt | 28 -- Source/Haiku/AutoLocker.h | 178 ------- Source/Haiku/CommandPipe.cpp | 367 --------------- Source/Haiku/CommandPipe.h | 98 ---- Source/Haiku/ObjectList.h | 866 ----------------------------------- Source/Makefile | 135 ++++++ 9 files changed, 136 insertions(+), 1706 deletions(-) delete mode 100644 CMakeLists.txt delete mode 100644 CMakeModules/UseHaiku.cmake delete mode 100644 Source/CMakeLists.txt delete mode 100644 Source/Haiku/AutoLocker.h delete mode 100644 Source/Haiku/CommandPipe.cpp delete mode 100644 Source/Haiku/CommandPipe.h delete mode 100644 Source/Haiku/ObjectList.h create mode 100644 Source/Makefile diff --git a/.gitignore b/.gitignore index b1636f6..96586cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1 @@ -BurnItNow -cmake_install.cmake -CMakeCache.txt -Makefile - -CMakeFiles/ - -Source/Makefile -Source/CMakeFiles/ +objects*/ diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index baf341a..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -project(BURNITNOW) - -set(CMAKE_MODULE_PATH "${BURNITNOW_SOURCE_DIR}/CMakeModules") - -include(UseHaiku) - -add_subdirectory(Source) diff --git a/CMakeModules/UseHaiku.cmake b/CMakeModules/UseHaiku.cmake deleted file mode 100644 index a349406..0000000 --- a/CMakeModules/UseHaiku.cmake +++ /dev/null @@ -1,151 +0,0 @@ -# -# - Haiku module for CMake -# - -# -# Override the default add_executable() command and add our own. -# -function(ADD_EXECUTABLE TARGET) - - foreach(arg ${ARGN}) - if (${arg} MATCHES ".*rdef$") - list(APPEND REAL_RDEFS ${arg}) - elseif(${arg} MATCHES ".*rsrc$") - list(APPEND REAL_RSRCS ${arg}) - else(${arg} MATCHES ".*rdef$") - list(APPEND REAL_SOURCES ${arg}) - endif(${arg} MATCHES ".*rdef$") - endforeach(arg) - - # Call the original function with the filtered source list. - _add_executable(${TARGET} ${REAL_SOURCES}) - - # Check to make sure there are rdefs in the source file list. - list(LENGTH REAL_RDEFS REAL_RDEFS_LENGTH) - if (${REAL_RDEFS_LENGTH} GREATER 0) - haiku_add_resource_defs(${TARGET} ${REAL_RDEFS}) - endif(${REAL_RDEFS_LENGTH} GREATER 0) - - # Check to make sure there are rsrcs in the source file list. - list(LENGTH REAL_RSRCS REAL_RSRCS_LENGTH) - if (${REAL_RSRCS_LENGTH} GREATER 0) - haiku_add_resource_defs(${TARGET} ${REAL_RSRCS}) - endif(${REAL_RSRCS_LENGTH} GREATER 0) - - haiku_auto_mimetype(${TARGET}) - -endfunction(ADD_EXECUTABLE) - -# -# Compile a resource definition file(.rdef) to a resource file(.rsrc) -# -function(HAIKU_COMPILE_RESOURCE_DEF RDEF_SOURCE) - - get_filename_component(rdefpath ${RDEF_SOURCE} ABSOLUTE) - get_filename_component(rdeffile ${RDEF_SOURCE} NAME_WE) - - set(rsrcfile "${rdeffile}.rsrc") - set(rsrcpath "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${rsrcfile}.dir/${rsrcfile}") - - add_custom_command( - OUTPUT ${rsrcpath} - COMMAND "rc" "-o" "${rsrcpath}" "${rdefpath}" - DEPENDS ${rdefpath} - COMMENT "Compiling resource ${rsrcpath}") - - add_custom_target(${rsrcfile} DEPENDS ${rsrcpath}) - - set_source_files_properties(${rsrcfile} PROPERTIES GENERATED TRUE) - - set(rsrcpath "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${rsrcfile}.dir/${rsrcfile}" PARENT_SCOPE) - -endfunction(HAIKU_COMPILE_RESOURCE_DEF) - -# -# Compile resource definition files(.rdef) to resource files(.rsrc). -# Add resources from the .rsrc files to the target. -# -function(HAIKU_ADD_RESOURCE_DEFS TARGET) - - foreach(rdef ${ARGN}) - haiku_compile_resource_def(${rdef} rsrcpath) - list(APPEND resources ${rsrcpath}) - endforeach(rdef ${ARGN}) - - haiku_add_resources_internal(${TARGET} ${resources}) - -endfunction(HAIKU_ADD_RESOURCE_DEFS) - - - -# -# Add resources from .rsrc files to the target. -# -function(HAIKU_ADD_RESOURCES TARGET) - - foreach(rsrc ${ARGN}) - list(APPEND rsrclist "${CMAKE_CURRENT_SOURCE_DIR}/${rsrc}") - endforeach(rsrc ${ARGN}) - - haiku_add_resources_internal(${TARGET} ${rsrclist}) - -endfunction(HAIKU_ADD_RESOURCES) - - - -# -# Add resources from .rsrc files to the target. -# This is the internal version meant to be called from this module only. -# -function(HAIKU_ADD_RESOURCES_INTERNAL TARGET) - - get_target_property(TARGET_PATH ${TARGET} LOCATION) - - if(NOT TARGET_PATH) - message(SEND_ERROR "Unable to determine target location for HAIKU_ADD_RESOURCE") - endif(NOT TARGET_PATH) - - add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND "xres" "-o" "${TARGET_PATH}" ${ARGN} - COMMENT "Merging resources into ${TARGET_PATH}") - - foreach(rsrc ${ARGN}) - get_filename_component(rsrcfile ${rsrc} NAME) - - # FIXME: Need to fix the dependency so TARGET is rebuilt properly - # and doesn't need this hack - add_custom_target( - ${rsrcfile}_check - COMMAND "/bin/sh" "-c" "if [ '${rsrc}' -nt '${TARGET_PATH}' ]\\;then rm -f '${TARGET_PATH}'\\;fi") - - # Need this so that rsrcfile target is built before _check target - add_dependencies(${rsrcfile}_check ${rsrcfile}) - - add_dependencies(${TARGET} ${rsrcfile}_check) - endforeach(rsrc ${ARGN}) - -endfunction(HAIKU_ADD_RESOURCES_INTERNAL) - - -# -# Run "mimeset" command to automatically set mimetype attributes using sniffer rules. -# -function(HAIKU_AUTO_MIMETYPE TARGET) - - get_target_property(TARGET_LOC ${TARGET} LOCATION) - - if(NOT TARGET_LOC) - message(SEND_ERROR "Unable to determine target location for HAIKU_AUTO_MIMETYPE") - endif(NOT TARGET_LOC) - - add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND "mimeset" "-f" "${TARGET_LOC}" - COMMENT "Setting mimetype for ${TARGET_LOC}") - -endfunction(HAIKU_AUTO_MIMETYPE) - - diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt deleted file mode 100644 index d49a62b..0000000 --- a/Source/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -if(CMAKE_BUILD_TYPE STREQUAL "Debug") - add_definitions(-DDEBUG) -endif() - -set(EXECUTABLE_OUTPUT_PATH ${BURNITNOW_BINARY_DIR}) - -set(BURNITNOW_SRCS - BurnApplication.cpp - BurnWindow.cpp - CommandThread.cpp - CompilationAudioView.cpp - CompilationDataView.cpp - CompilationImageView.cpp - CompilationCDRWView.cpp - CompilationCloneView.cpp - BurnItNow.rdef - -# 3rd party sources - Haiku/CommandPipe.cpp -) - -add_executable(BurnItNow ${BURNITNOW_SRCS}) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-multichar -Woverloaded-virtual -Wno-unknown-pragmas -std=c++0x") - -include_directories(${BURNITNOW_SOURCE_DIR}/Source/Haiku) - -target_link_libraries(BurnItNow "be" "tracker") diff --git a/Source/Haiku/AutoLocker.h b/Source/Haiku/AutoLocker.h deleted file mode 100644 index 9baa7aa..0000000 --- a/Source/Haiku/AutoLocker.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright 2005-2007, Ingo Weinhold, bonefish@users.sf.net. - * All rights reserved. Distributed under the terms of the MIT License. - */ -#ifndef _AUTO_LOCKER_H -#define _AUTO_LOCKER_H - - -#include - - -namespace BPrivate { - -// AutoLockerStandardLocking -template -class AutoLockerStandardLocking { -public: - inline bool Lock(Lockable* lockable) - { - return lockable->Lock(); - } - - inline void Unlock(Lockable* lockable) - { - lockable->Unlock(); - } -}; - -// AutoLockerReadLocking -template -class AutoLockerReadLocking { -public: - inline bool Lock(Lockable* lockable) - { - return lockable->ReadLock(); - } - - inline void Unlock(Lockable* lockable) - { - lockable->ReadUnlock(); - } -}; - -// AutoLockerWriteLocking -template -class AutoLockerWriteLocking { -public: - inline bool Lock(Lockable* lockable) - { - return lockable->WriteLock(); - } - - inline void Unlock(Lockable* lockable) - { - lockable->WriteUnlock(); - } -}; - -// AutoLocker -template > -class AutoLocker { -private: - typedef AutoLocker ThisClass; -public: - inline AutoLocker() - : - fLockable(NULL), - fLocked(false) - { - } - - inline AutoLocker(const Locking& locking) - : - fLockable(NULL), - fLocking(locking), - fLocked(false) - { - } - - inline AutoLocker(Lockable* lockable, bool alreadyLocked = false, - bool lockIfNotLocked = true) - : - fLockable(lockable), - fLocked(fLockable && alreadyLocked) - { - if (!alreadyLocked && lockIfNotLocked) - Lock(); - } - - inline AutoLocker(Lockable& lockable, bool alreadyLocked = false, - bool lockIfNotLocked = true) - : - fLockable(&lockable), - fLocked(fLockable && alreadyLocked) - { - if (!alreadyLocked && lockIfNotLocked) - Lock(); - } - - inline ~AutoLocker() - { - Unlock(); - } - - inline void SetTo(Lockable* lockable, bool alreadyLocked, - bool lockIfNotLocked = true) - { - Unlock(); - fLockable = lockable; - fLocked = (lockable && alreadyLocked); - if (!alreadyLocked && lockIfNotLocked) - Lock(); - } - - inline void SetTo(Lockable& lockable, bool alreadyLocked, - bool lockIfNotLocked = true) - { - SetTo(&lockable, alreadyLocked, lockIfNotLocked); - } - - inline void Unset() - { - Unlock(); - Detach(); - } - - inline bool Lock() - { - if (fLockable && !fLocked) - fLocked = fLocking.Lock(fLockable); - return fLocked; - } - - inline void Unlock() - { - if (fLockable && fLocked) { - fLocking.Unlock(fLockable); - fLocked = false; - } - } - - inline void Detach() - { - fLockable = NULL; - fLocked = false; - } - - inline AutoLocker& operator=(Lockable* lockable) - { - SetTo(lockable); - return *this; - } - - inline AutoLocker& operator=(Lockable& lockable) - { - SetTo(&lockable); - return *this; - } - - inline bool IsLocked() const { return fLocked; } - - inline operator bool() const { return fLocked; } - -protected: - Lockable* fLockable; - Locking fLocking; - bool fLocked; -}; - - -} // namespace BPrivate - -using BPrivate::AutoLocker; -using BPrivate::AutoLockerReadLocking; -using BPrivate::AutoLockerWriteLocking; - -#endif // _AUTO_LOCKER_H diff --git a/Source/Haiku/CommandPipe.cpp b/Source/Haiku/CommandPipe.cpp deleted file mode 100644 index b0b1d12..0000000 --- a/Source/Haiku/CommandPipe.cpp +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright 2007 Haiku, Inc. All rights reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * Ramshankar, v.ramshankar@gmail.com - * Stephan Aßmus - */ - -//! BCommandPipe class to handle reading shell output -// (stdout/stderr) of other programs into memory. -#include "CommandPipe.h" - -#include -#include - -#include -#include -#include -#include - - -BCommandPipe::BCommandPipe() - : - fStdOutOpen(false), - fStdErrOpen(false) -{ -} - - -BCommandPipe::~BCommandPipe() -{ - FlushArgs(); -} - - -status_t -BCommandPipe::AddArg(const char* arg) -{ - if (arg == NULL || arg[0] == '\0') - return B_BAD_VALUE; - - char* argCopy = strdup(arg); - if (argCopy == NULL) - return B_NO_MEMORY; - - if (!fArgList.AddItem(reinterpret_cast(argCopy))) { - free(argCopy); - return B_NO_MEMORY; - } - - return B_OK; -} - - -void -BCommandPipe::PrintToStream() const -{ - for (int32 i = 0L; i < fArgList.CountItems(); i++) - printf("%s ", reinterpret_cast(fArgList.ItemAtFast(i))); - - printf("\n"); -} - - -void -BCommandPipe::FlushArgs() -{ - // Delete all arguments from the list - for (int32 i = fArgList.CountItems() - 1; i >= 0; i--) - free(fArgList.ItemAtFast(i)); - fArgList.MakeEmpty(); - - Close(); -} - - -void -BCommandPipe::Close() -{ - if (fStdErrOpen) { - close(fStdErr[0]); - fStdErrOpen = false; - } - - if (fStdOutOpen) { - close(fStdOut[0]); - fStdOutOpen = false; - } -} - - -const char** -BCommandPipe::Argv(int32& argc) const -{ - // NOTE: Freeing is left to caller as indicated in the header! - argc = fArgList.CountItems(); - const char** argv = reinterpret_cast( - malloc((argc + 1) * sizeof(char*))); - for (int32 i = 0; i < argc; i++) - argv[i] = reinterpret_cast(fArgList.ItemAtFast(i)); - - argv[argc] = NULL; - return argv; -} - - -// #pragma mark - - - -thread_id -BCommandPipe::PipeAll(int* stdOutAndErr) const -{ - // This function pipes both stdout and stderr to the same filedescriptor - // (stdOut) - int oldStdOut; - int oldStdErr; - pipe(stdOutAndErr); - oldStdOut = dup(STDOUT_FILENO); - oldStdErr = dup(STDERR_FILENO); - close(STDOUT_FILENO); - close(STDERR_FILENO); - // TODO: This looks broken, using "stdOutAndErr[1]" twice! - dup2(stdOutAndErr[1], STDOUT_FILENO); - dup2(stdOutAndErr[1], STDERR_FILENO); - - // Construct the argv vector - int32 argc; - const char** argv = Argv(argc); - - // Load the app image... and pass the args - thread_id appThread = load_image((int)argc, argv, - const_cast(environ)); - - dup2(oldStdOut, STDOUT_FILENO); - dup2(oldStdErr, STDERR_FILENO); - close(oldStdOut); - close(oldStdErr); - - free(argv); - - return appThread; -} - - -thread_id -BCommandPipe::Pipe(int* stdOut, int* stdErr) const -{ - int oldStdOut; - int oldStdErr; - pipe(stdOut); - pipe(stdErr); - oldStdOut = dup(STDOUT_FILENO); - oldStdErr = dup(STDERR_FILENO); - close(STDOUT_FILENO); - close(STDERR_FILENO); - dup2(stdOut[1], STDOUT_FILENO); - dup2(stdErr[1], STDERR_FILENO); - - // Construct the argv vector - int32 argc; - const char** argv = Argv(argc); - - // Load the app image... and pass the args - thread_id appThread = load_image((int)argc, argv, const_cast< - const char**>(environ)); - - dup2(oldStdOut, STDOUT_FILENO); - dup2(oldStdErr, STDERR_FILENO); - close(oldStdOut); - close(oldStdErr); - - free(argv); - - return appThread; -} - - -thread_id -BCommandPipe::Pipe(int* stdOut) const -{ - // Redirects only output (stdout) to caller, stderr is closed - int stdErr[2]; - thread_id tid = Pipe(stdOut, stdErr); - close(stdErr[0]); - close(stdErr[1]); - return tid; -} - - -thread_id -BCommandPipe::PipeInto(FILE** _out, FILE** _err) -{ - Close(); - - thread_id tid = Pipe(fStdOut, fStdErr); - if (tid >= 0) - resume_thread(tid); - - close(fStdErr[1]); - close(fStdOut[1]); - - fStdOutOpen = true; - fStdErrOpen = true; - - *_out = fdopen(fStdOut[0], "r"); - *_err = fdopen(fStdErr[0], "r"); - - return tid; -} - - -thread_id -BCommandPipe::PipeInto(FILE** _outAndErr) -{ - Close(); - - thread_id tid = PipeAll(fStdOut); - if (tid >= 0) - resume_thread(tid); - - close(fStdOut[1]); - fStdOutOpen = true; - - *_outAndErr = fdopen(fStdOut[0], "r"); - return tid; -} - - -// #pragma mark - - - -void -BCommandPipe::Run() -{ - // Runs the command without bothering to redirect streams, this is similar - // to system() but uses pipes and wait_for_thread.... Synchronous. - int stdOut[2], stdErr[2]; - status_t exitCode; - wait_for_thread(Pipe(stdOut, stdErr), &exitCode); - - close(stdOut[0]); - close(stdErr[0]); - close(stdOut[1]); - close(stdErr[1]); -} - - -void -BCommandPipe::RunAsync() -{ - // Runs the command without bothering to redirect streams, this is similar - // to system() but uses pipes.... Asynchronous. - Close(); - FILE* f = NULL; - PipeInto(&f); - fclose(f); -} - - -// #pragma mark - - - -status_t -BCommandPipe::ReadLines(FILE* file, LineReader* lineReader) -{ - // Reads output of file, line by line. Each line is passed to lineReader - // for inspection, and the IsCanceled() method is repeatedly called. - - if (file == NULL || lineReader == NULL) - return B_BAD_VALUE; - - BString line; - - while (!feof(file)) { - if (lineReader->IsCanceled()) - return B_CANCELED; - - unsigned char c = fgetc(file); - // TODO: fgetc() blocks, is there a way to make it timeout? - - if (c != 255) - line << (char)c; - - if (c == '\n') { - status_t ret = lineReader->ReadLine(line); - if (ret != B_OK) - return ret; - line = ""; - } - } - - return B_OK; -} - - -BString -BCommandPipe::ReadLines(FILE* file) -{ - class AllLinesReader : public LineReader { - public: - AllLinesReader() - : - fResult("") - { - } - - virtual bool IsCanceled() - { - return false; - } - - virtual status_t ReadLine(const BString& line) - { - int lineLength = line.Length(); - int resultLength = fResult.Length(); - fResult << line; - if (fResult.Length() != lineLength + resultLength) - return B_NO_MEMORY; - return B_OK; - } - - BString Result() const - { - return fResult; - } - - private: - BString fResult; - } lineReader; - - ReadLines(file, &lineReader); - - return lineReader.Result(); -} - - -// #pragma mark - - - -BCommandPipe& -BCommandPipe::operator<<(const char* arg) -{ - AddArg(arg); - return *this; -} - - -BCommandPipe& -BCommandPipe::operator<<(const BString& arg) -{ - AddArg(arg.String()); - return *this; -} - - -BCommandPipe& -BCommandPipe::operator<<(const BCommandPipe& arg) -{ - int32 argc; - const char** argv = arg.Argv(argc); - for (int32 i = 0; i < argc; i++) - AddArg(argv[i]); - - return *this; -} - diff --git a/Source/Haiku/CommandPipe.h b/Source/Haiku/CommandPipe.h deleted file mode 100644 index 0c71b70..0000000 --- a/Source/Haiku/CommandPipe.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2007 Haiku, Inc. All rights reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * Ramshankar, v.ramshankar@gmail.com - */ -#ifndef _COMMAND_PIPE_H -#define _COMMAND_PIPE_H - - -#include - -#include -#include - - -class BMessage; -class BMessenger; -class BString; - -namespace BPrivate { - -class BCommandPipe { -public: - BCommandPipe(); - virtual ~BCommandPipe(); - - status_t AddArg(const char* argv); - void PrintToStream() const; - - // FlushArgs() deletes the commands while Close() explicity closes all - // pending pipe-ends - // Note: Internally FlushArgs() calls Close() - void FlushArgs(); - void Close(); - - // You MUST NOT free/delete the strings in the array, but you MUST free - // just the array itself. - const char** Argv(int32& _argc) const; - - // If you use these, you must explicitly call "close" for the parameters - // (stdOut/stdErr) when you are done with them! - thread_id Pipe(int* stdOut, int* stdErr) const; - thread_id Pipe(int* stdOut) const; - thread_id PipeAll(int* stdOutAndErr) const; - - // If you use these, you need NOT call "fclose" for the parameters - // (out/err) when you are done with them, also you need not do any - // allocation for these FILE* pointers, just use FILE* out = NULL - // and pass &out and so on... - thread_id PipeInto(FILE** _out, FILE** _err); - thread_id PipeInto(FILE** _outAndErr); - - // Run() is a synchronous call, and waits till the command has finished - // executing RunAsync() is an asynchronous call that returns immediately - // after launching the command Neither of these bother about redirecting - // pipes for you to use - void Run(); - void RunAsync(); - - // Reading the Pipe output - - class LineReader { - public: - virtual ~LineReader() {} - virtual bool IsCanceled() = 0; - virtual status_t ReadLine(const BString& line) = 0; - // TODO: Add a Timeout() method. - }; - - // This function reads line-by-line from "file". It calls IsCanceled() - // on the passed LineReader instance for each byte read from file - // (currently). And it calls ReadLine() for each complete line. - status_t ReadLines(FILE* file, LineReader* lineReader); - // This method can be used to read the entire file into a BString. - BString ReadLines(FILE* file); - - // Stardard append operators, if you use pointers to a BCommandPipe, - // you must use *pipe << "command"; and not pipe << "command" (as it - // will not compile that way) - BCommandPipe& operator<<(const char* arg); - BCommandPipe& operator<<(const BString& arg); - BCommandPipe& operator<<(const BCommandPipe& arg); - -protected: - BList fArgList; - int fStdOut[2]; - int fStdErr[2]; - bool fStdOutOpen; - bool fStdErrOpen; -}; - -} // namespace BPrivate - -using BPrivate::BCommandPipe; - -#endif // _COMMAND_PIPE_H diff --git a/Source/Haiku/ObjectList.h b/Source/Haiku/ObjectList.h deleted file mode 100644 index bfa1832..0000000 --- a/Source/Haiku/ObjectList.h +++ /dev/null @@ -1,866 +0,0 @@ -/* -Open Tracker License - -Terms and Conditions - -Copyright (c) 1991-2000, Be Incorporated. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice applies to all licensees -and shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -BE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Be Incorporated shall not be -used in advertising or otherwise to promote the sale, use or other dealings in -this Software without prior written authorization from Be Incorporated. - -Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks -of Be Incorporated in the United States and other countries. Other brand product -names are registered trademarks or trademarks of their respective holders. -All rights reserved. -*/ - -/**************************************************************************** -** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ** -** ** -** DANGER, WILL ROBINSON! ** -** ** -** The interfaces contained here are part of BeOS's ** -** ** -** >> PRIVATE NOT FOR PUBLIC USE << ** -** ** -** implementation. ** -** ** -** These interfaces WILL CHANGE in future releases. ** -** If you use them, your app WILL BREAK at some future time. ** -** ** -** (And yes, this does mean that binaries built from OpenTracker will not ** -** be compatible with some future releases of the OS. When that happens, ** -** we will provide an updated version of this file to keep compatibility.) ** -** ** -** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ** -****************************************************************************/ - -// -// ObjectList is a wrapper around BList that adds type safety, -// optional object ownership, search, insert operations, etc. -// - -#ifndef __OBJECT_LIST__ -#define __OBJECT_LIST__ - -#ifndef _BE_H -#include -#endif - -#include - - -template class BObjectList; - -template -struct UnaryPredicate { - - virtual int operator()(const T *) const - // virtual could be avoided here if FindBinaryInsertionIndex, - // etc. were member template functions - { return 0; } - -private: - static int _unary_predicate_glue(const void *item, void *context); - -friend class BObjectList; -}; - -template -int -UnaryPredicate::_unary_predicate_glue(const void *item, void *context) -{ - return ((UnaryPredicate *)context)->operator()((const T *)item); -} - - -class _PointerList_ : public BList { -public: - _PointerList_(const _PointerList_ &list); - _PointerList_(int32 itemsPerBlock = 20, bool owning = false); - ~_PointerList_(); - - typedef void *(* GenericEachFunction)(void *, void *); - typedef int (* GenericCompareFunction)(const void *, const void *); - typedef int (* GenericCompareFunctionWithState)(const void *, const void *, - void *); - typedef int (* UnaryPredicateGlue)(const void *, void *); - - void *EachElement(GenericEachFunction, void *); - void SortItems(GenericCompareFunction); - void SortItems(GenericCompareFunctionWithState, void *state); - void HSortItems(GenericCompareFunction); - void HSortItems(GenericCompareFunctionWithState, void *state); - - void *BinarySearch(const void *, GenericCompareFunction) const; - void *BinarySearch(const void *, GenericCompareFunctionWithState, void *state) const; - - int32 BinarySearchIndex(const void *, GenericCompareFunction) const; - int32 BinarySearchIndex(const void *, GenericCompareFunctionWithState, void *state) const; - int32 BinarySearchIndexByPredicate(const void *, UnaryPredicateGlue) const; - - bool Owning() const; - bool ReplaceItem(int32, void *); - -protected: - bool owning; - -}; - -template -class BObjectList : private _PointerList_ { -public: - - // iteration and sorting - typedef T *(* EachFunction)(T *, void *); - typedef const T *(* ConstEachFunction)(const T *, void *); - typedef int (* CompareFunction)(const T *, const T *); - typedef int (* CompareFunctionWithState)(const T *, const T *, void *state); - - BObjectList(int32 itemsPerBlock = 20, bool owning = false); - BObjectList(const BObjectList &list); - // clones list; if list is owning, makes copies of all - // the items - - virtual ~BObjectList(); - - BObjectList &operator=(const BObjectList &list); - // clones list; if list is owning, makes copies of all - // the items - - // adding and removing - // ToDo: - // change Add calls to return const item - bool AddItem(T *); - bool AddItem(T *, int32); - bool AddList(BObjectList *); - bool AddList(BObjectList *, int32); - - bool RemoveItem(T *, bool deleteIfOwning = true); - // if owning, deletes the removed item - T *RemoveItemAt(int32); - // returns the removed item - - void MakeEmpty(bool deleteIfOwning = true); - - // item access - T *ItemAt(int32) const; - - bool ReplaceItem(int32 index, T *); - // if list is owning, deletes the item at first - T *SwapWithItem(int32 index, T *newItem); - // same as ReplaceItem, except does not delete old item at , - // returns it instead - - T *FirstItem() const; - T *LastItem() const; - - // misc. getters - int32 IndexOf(const T *) const; - bool HasItem(const T *) const; - bool IsEmpty() const; - int32 CountItems() const; - - T *EachElement(EachFunction, void *); - const T *EachElement(ConstEachFunction, void *) const; - - void SortItems(CompareFunction); - void SortItems(CompareFunctionWithState, void *state); - void HSortItems(CompareFunction); - void HSortItems(CompareFunctionWithState, void *state); - - // linear search, returns first item that matches predicate - const T *FindIf(const UnaryPredicate &) const; - T *FindIf(const UnaryPredicate &); - - // list must be sorted with CompareFunction for these to work - T *BinarySearch(const T &, CompareFunction) const; - T *BinarySearch(const T &, CompareFunctionWithState, void *state) const; - - template - T *BinarySearchByKey(const Key &key, int (*compare)(const Key *, const T *)) - const; - - template - T *BinarySearchByKey(const Key &key, - int (*compare)(const Key *, const T *, void *), void *state) const; - - int32 BinarySearchIndex(const T &item, CompareFunction compare) const; - int32 BinarySearchIndex(const T &item, CompareFunctionWithState compare, - void *state) const; - - template - int32 BinarySearchIndexByKey(const Key &key, - int (*compare)(const Key *, const T *)) const; - - // Binary insertion - list must be sorted with CompareFunction for - // these to work - - // simple insert - bool BinaryInsert(T *, CompareFunction); - bool BinaryInsert(T *, CompareFunctionWithState, void *state); - bool BinaryInsert(T *, const UnaryPredicate &); - - // unique insert, returns false if item already in list - bool BinaryInsertUnique(T *, CompareFunction); - bool BinaryInsertUnique(T *, CompareFunctionWithState, void *state); - bool BinaryInsertUnique(T *, const UnaryPredicate &); - - // insert a copy of the item, returns new inserted item - T *BinaryInsertCopy(const T ©This, CompareFunction); - T *BinaryInsertCopy(const T ©This, CompareFunctionWithState, void *state); - - // insert a copy of the item if not in list already - // returns new inserted item or existing item in case of a conflict - T *BinaryInsertCopyUnique(const T ©This, CompareFunction); - T *BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState, void *state); - - int32 FindBinaryInsertionIndex(const UnaryPredicate &, bool *alreadyInList = 0) const; - // returns either the index into which a new item should be inserted - // or index of an existing item that matches the predicate - - // deprecated API, will go away - BList *AsBList() - { return this; } - const BList *AsBList() const - { return this; } -private: - void SetItem(int32, T *); -}; - -template -Result -WhileEachListItem(BObjectList *list, Result (Item::*func)(Param1), Param1 p1) -{ - Result result = 0; - int32 count = list->CountItems(); - - for (int32 index = 0; index < count; index++) - if ((result = (list->ItemAt(index)->*func)(p1)) != 0) - break; - - return result; -} - -template -Result -WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1), Param1 p1) -{ - Result result = 0; - int32 count = list->CountItems(); - - for (int32 index = 0; index < count; index++) - if ((result = (*func)(list->ItemAt(index), p1)) != 0) - break; - - return result; -} - -template -Result -WhileEachListItem(BObjectList *list, Result (Item::*func)(Param1, Param2), - Param1 p1, Param2 p2) -{ - Result result = 0; - int32 count = list->CountItems(); - - for (int32 index = 0; index < count; index++) - if ((result = (list->ItemAt(index)->*func)(p1, p2)) != 0) - break; - - return result; -} - -template -Result -WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1, Param2), - Param1 p1, Param2 p2) -{ - Result result = 0; - int32 count = list->CountItems(); - - for (int32 index = 0; index < count; index++) - if ((result = (*func)(list->ItemAt(index), p1, p2)) != 0) - break; - - return result; -} - -template -Result -WhileEachListItem(BObjectList *list, Result (*func)(Item *, Param1, Param2, - Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4) -{ - Result result = 0; - int32 count = list->CountItems(); - - for (int32 index = 0; index < count; index++) - if ((result = (*func)(list->ItemAt(index), p1, p2, p3, p4)) != 0) - break; - - return result; -} - -template -void -EachListItemIgnoreResult(BObjectList *list, Result (Item::*func)()) -{ - int32 count = list->CountItems(); - for (int32 index = 0; index < count; index++) - (list->ItemAt(index)->*func)(); -} - -template -void -EachListItem(BObjectList *list, void (*func)(Item *, Param1), Param1 p1) -{ - int32 count = list->CountItems(); - for (int32 index = 0; index < count; index++) - (func)(list->ItemAt(index), p1); -} - -template -void -EachListItem(BObjectList *list, void (Item::*func)(Param1, Param2), - Param1 p1, Param2 p2) -{ - int32 count = list->CountItems(); - for (int32 index = 0; index < count; index++) - (list->ItemAt(index)->*func)(p1, p2); -} - -template -void -EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2), - Param1 p1, Param2 p2) -{ - int32 count = list->CountItems(); - for (int32 index = 0; index < count; index++) - (func)(list->ItemAt(index), p1, p2); -} - -template -void -EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2, - Param3), Param1 p1, Param2 p2, Param3 p3) -{ - int32 count = list->CountItems(); - for (int32 index = 0; index < count; index++) - (func)(list->ItemAt(index), p1, p2, p3); -} - - -template -void -EachListItem(BObjectList *list, void (*func)(Item *,Param1, Param2, - Param3, Param4), Param1 p1, Param2 p2, Param3 p3, Param4 p4) -{ - int32 count = list->CountItems(); - for (int32 index = 0; index < count; index++) - (func)(list->ItemAt(index), p1, p2, p3, p4); -} - -// inline code - -inline bool -_PointerList_::Owning() const -{ - return owning; -} - -template -BObjectList::BObjectList(int32 itemsPerBlock, bool owning) - : _PointerList_(itemsPerBlock, owning) -{ -} - -template -BObjectList::BObjectList(const BObjectList &list) - : _PointerList_(list) -{ - owning = list.owning; - if (owning) { - // make our own copies in an owning list - int32 count = list.CountItems(); - for (int32 index = 0; index < count; index++) { - T *item = list.ItemAt(index); - if (item) - item = new T(*item); - SetItem(index, item); - } - } -} - -template -BObjectList::~BObjectList() -{ - if (Owning()) - // have to nuke elements first - MakeEmpty(); -} - -template -BObjectList & -BObjectList::operator=(const BObjectList &list) -{ - owning = list.owning; - BObjectList &result = (BObjectList &)_PointerList_::operator=(list); - if (owning) { - // make our own copies in an owning list - int32 count = list.CountItems(); - for (int32 index = 0; index < count; index++) { - T *item = list.ItemAt(index); - if (item) - item = new T(*item); - SetItem(index, item); - } - } - return result; -} - -template -bool -BObjectList::AddItem(T *item) -{ - // need to cast to void * to make T work for const pointers - return _PointerList_::AddItem((void *)item); -} - -template -bool -BObjectList::AddItem(T *item, int32 atIndex) -{ - return _PointerList_::AddItem((void *)item, atIndex); -} - -template -bool -BObjectList::AddList(BObjectList *newItems) -{ - return _PointerList_::AddList(newItems); -} - -template -bool -BObjectList::AddList(BObjectList *newItems, int32 atIndex) -{ - return _PointerList_::AddList(newItems, atIndex); -} - - -template -bool -BObjectList::RemoveItem(T *item, bool deleteIfOwning) -{ - bool result = _PointerList_::RemoveItem((void *)item); - - if (result && Owning() && deleteIfOwning) - delete item; - - return result; -} - -template -T * -BObjectList::RemoveItemAt(int32 index) -{ - return (T *)_PointerList_::RemoveItem(index); -} - -template -inline T * -BObjectList::ItemAt(int32 index) const -{ - return (T *)_PointerList_::ItemAt(index); -} - -template -bool -BObjectList::ReplaceItem(int32 index, T *item) -{ - if (owning) - delete ItemAt(index); - return _PointerList_::ReplaceItem(index, (void *)item); -} - -template -T * -BObjectList::SwapWithItem(int32 index, T *newItem) -{ - T *result = ItemAt(index); - _PointerList_::ReplaceItem(index, (void *)newItem); - return result; -} - -template -void -BObjectList::SetItem(int32 index, T *newItem) -{ - _PointerList_::ReplaceItem(index, (void *)newItem); -} - -template -int32 -BObjectList::IndexOf(const T *item) const -{ - return _PointerList_::IndexOf((void *)item); -} - -template -T * -BObjectList::FirstItem() const -{ - return (T *)_PointerList_::FirstItem(); -} - -template -T * -BObjectList::LastItem() const -{ - return (T *)_PointerList_::LastItem(); -} - -template -bool -BObjectList::HasItem(const T *item) const -{ - return _PointerList_::HasItem((void *)item); -} - -template -bool -BObjectList::IsEmpty() const -{ - return _PointerList_::IsEmpty(); -} - -template -int32 -BObjectList::CountItems() const -{ - return _PointerList_::CountItems(); -} - -template -void -BObjectList::MakeEmpty(bool deleteIfOwning) -{ - if (owning && deleteIfOwning) { - int32 count = CountItems(); - for (int32 index = 0; index < count; index++) - delete ItemAt(index); - } - _PointerList_::MakeEmpty(); -} - -template -T * -BObjectList::EachElement(EachFunction func, void *params) -{ - return (T *)_PointerList_::EachElement((GenericEachFunction)func, params); -} - - -template -const T * -BObjectList::EachElement(ConstEachFunction func, void *params) const -{ - return (const T *) - const_cast *>(this)->_PointerList_::EachElement( - (GenericEachFunction)func, params); -} - -template -const T * -BObjectList::FindIf(const UnaryPredicate &predicate) const -{ - int32 count = CountItems(); - for (int32 index = 0; index < count; index++) - if (predicate.operator()(ItemAt(index)) == 0) - return ItemAt(index); - return 0; -} - -template -T * -BObjectList::FindIf(const UnaryPredicate &predicate) -{ - int32 count = CountItems(); - for (int32 index = 0; index < count; index++) - if (predicate.operator()(ItemAt(index)) == 0) - return ItemAt(index); - return 0; -} - - -template -void -BObjectList::SortItems(CompareFunction function) -{ - _PointerList_::SortItems((GenericCompareFunction)function); -} - -template -void -BObjectList::SortItems(CompareFunctionWithState function, void *state) -{ - _PointerList_::SortItems((GenericCompareFunctionWithState)function, state); -} - -template -void -BObjectList::HSortItems(CompareFunction function) -{ - _PointerList_::HSortItems((GenericCompareFunction)function); -} - -template -void -BObjectList::HSortItems(CompareFunctionWithState function, void *state) -{ - _PointerList_::HSortItems((GenericCompareFunctionWithState)function, state); -} - -template -T * -BObjectList::BinarySearch(const T &key, CompareFunction func) const -{ - return (T*)_PointerList_::BinarySearch(&key, - (GenericCompareFunction)func); -} - -template -T * -BObjectList::BinarySearch(const T &key, CompareFunctionWithState func, void *state) const -{ - return (T*)_PointerList_::BinarySearch(&key, - (GenericCompareFunctionWithState)func, state); -} - - -template -template -T * -BObjectList::BinarySearchByKey(const Key &key, - int (*compare)(const Key *, const T *)) const -{ - return (T*)_PointerList_::BinarySearch(&key, - (GenericCompareFunction)compare); -} - - -template -template -T * -BObjectList::BinarySearchByKey(const Key &key, - int (*compare)(const Key *, const T *, void *), void *state) const -{ - return (T*)_PointerList_::BinarySearch(&key, - (GenericCompareFunctionWithState)compare, state); -} - - -template -int32 -BObjectList::BinarySearchIndex(const T &item, CompareFunction compare) const -{ - return _PointerList_::BinarySearchIndex(&item, - (GenericCompareFunction)compare); -} - - -template -int32 -BObjectList::BinarySearchIndex(const T &item, - CompareFunctionWithState compare, void *state) const -{ - return _PointerList_::BinarySearchIndex(&item, - (GenericCompareFunctionWithState)compare, state); -} - - -template -template -int32 -BObjectList::BinarySearchIndexByKey(const Key &key, - int (*compare)(const Key *, const T *)) const -{ - return _PointerList_::BinarySearchIndex(&key, - (GenericCompareFunction)compare); -} - - -template -bool -BObjectList::BinaryInsert(T *item, CompareFunction func) -{ - int32 index = _PointerList_::BinarySearchIndex(item, - (GenericCompareFunction)func); - if (index >= 0) { - // already in list, add after existing - return AddItem(item, index + 1); - } - - return AddItem(item, -index - 1); -} - -template -bool -BObjectList::BinaryInsert(T *item, CompareFunctionWithState func, void *state) -{ - int32 index = _PointerList_::BinarySearchIndex(item, - (GenericCompareFunctionWithState)func, state); - if (index >= 0) { - // already in list, add after existing - return AddItem(item, index + 1); - } - - return AddItem(item, -index - 1); -} - -template -bool -BObjectList::BinaryInsertUnique(T *item, CompareFunction func) -{ - int32 index = _PointerList_::BinarySearchIndex(item, - (GenericCompareFunction)func); - if (index >= 0) - return false; - - return AddItem(item, -index - 1); -} - -template -bool -BObjectList::BinaryInsertUnique(T *item, CompareFunctionWithState func, void *state) -{ - int32 index = _PointerList_::BinarySearchIndex(item, - (GenericCompareFunctionWithState)func, state); - if (index >= 0) - return false; - - return AddItem(item, -index - 1); -} - - -template -T * -BObjectList::BinaryInsertCopy(const T ©This, CompareFunction func) -{ - int32 index = _PointerList_::BinarySearchIndex(©This, - (GenericCompareFunction)func); - - if (index >= 0) - index++; - else - index = -index - 1; - - T *newItem = new T(copyThis); - AddItem(newItem, index); - return newItem; -} - -template -T * -BObjectList::BinaryInsertCopy(const T ©This, CompareFunctionWithState func, void *state) -{ - int32 index = _PointerList_::BinarySearchIndex(©This, - (GenericCompareFunctionWithState)func, state); - - if (index >= 0) - index++; - else - index = -index - 1; - - T *newItem = new T(copyThis); - AddItem(newItem, index); - return newItem; -} - -template -T * -BObjectList::BinaryInsertCopyUnique(const T ©This, CompareFunction func) -{ - int32 index = _PointerList_::BinarySearchIndex(©This, - (GenericCompareFunction)func); - if (index >= 0) - return ItemAt(index); - - index = -index - 1; - T *newItem = new T(copyThis); - AddItem(newItem, index); - return newItem; -} - -template -T * -BObjectList::BinaryInsertCopyUnique(const T ©This, CompareFunctionWithState func, - void *state) -{ - int32 index = _PointerList_::BinarySearchIndex(©This, - (GenericCompareFunctionWithState)func, state); - if (index >= 0) - return ItemAt(index); - - index = -index - 1; - T *newItem = new T(copyThis); - AddItem(newItem, index); - return newItem; -} - -template -int32 -BObjectList::FindBinaryInsertionIndex(const UnaryPredicate &pred, bool *alreadyInList) - const -{ - int32 index = _PointerList_::BinarySearchIndexByPredicate(&pred, - (UnaryPredicateGlue)&UnaryPredicate::_unary_predicate_glue); - - if (alreadyInList) - *alreadyInList = index >= 0; - - if (index < 0) - index = -index - 1; - - return index; -} - -template -bool -BObjectList::BinaryInsert(T *item, const UnaryPredicate &pred) -{ - return AddItem(item, FindBinaryInsertionIndex(pred)); -} - -template -bool -BObjectList::BinaryInsertUnique(T *item, const UnaryPredicate &pred) -{ - bool alreadyInList; - int32 index = FindBinaryInsertionIndex(pred, &alreadyInList); - if (alreadyInList) - return false; - - AddItem(item, index); - return true; -} - -#endif /* __OBJECT_LIST__ */ diff --git a/Source/Makefile b/Source/Makefile new file mode 100644 index 0000000..84ebb72 --- /dev/null +++ b/Source/Makefile @@ -0,0 +1,135 @@ +## Haiku Generic Makefile v2.6 ## + +## Fill in this file to specify the project being created, and the referenced +## Makefile-Engine will do all of the hard work for you. This handles any +## architecture of Haiku. + +# The name of the binary. +NAME = BurnItNow + +# The type of binary, must be one of: +# APP: Application +# SHARED: Shared library or add-on +# STATIC: Static library archive +# DRIVER: Kernel driver +TYPE = APP + +# If you plan to use localization, specify the application's MIME signature. +APP_MIME_SIG = + +# The following lines tell Pe and Eddie where the SRCS, RDEFS, and RSRCS are +# so that Pe and Eddie can fill them in for you. +#%{ +# @src->@ + +# Specify the source files to use. Full paths or paths relative to the +# Makefile can be included. All files, regardless of directory, will have +# their object files created in the common object directory. Note that this +# means this Makefile will not work correctly if two source files with the +# same name (source.c or source.cpp) are included from different directories. +# Also note that spaces in folder names do not work well with this Makefile. +SRCS = BurnApplication.cpp \ + BurnWindow.cpp \ + CommandThread.cpp \ + CompilationAudioView.cpp \ + CompilationDataView.cpp \ + CompilationImageView.cpp \ + CompilationCDRWView.cpp \ + CompilationCloneView.cpp + +# Specify the resource definition files to use. Full or relative paths can be +# used. +RDEFS = BurnItNow.rdef + +# Specify the resource files to use. Full or relative paths can be used. +# Both RDEFS and RSRCS can be utilized in the same Makefile. +RSRCS = + +# End Pe/Eddie support. +# @<-src@ +#%} + +# Specify libraries to link against. +# There are two acceptable forms of library specifications: +# - if your library follows the naming pattern of libXXX.so or libXXX.a, +# you can simply specify XXX for the library. (e.g. the entry for +# "libtracker.so" would be "tracker") +# +# - for GCC-independent linking of standard C++ libraries, you can use +# $(STDCPPLIBS) instead of the raw "stdc++[.r4] [supc++]" library names. +# +# - if your library does not follow the standard library naming scheme, +# you need to specify the path to the library and it's name. +# (e.g. for mylib.a, specify "mylib.a" or "path/mylib.a") +LIBS = be tracker shared $(STDCPPLIBS) + +# Specify additional paths to directories following the standard libXXX.so +# or libXXX.a naming scheme. You can specify full paths or paths relative +# to the Makefile. The paths included are not parsed recursively, so +# include all of the paths where libraries must be found. Directories where +# source files were specified are automatically included. +LIBPATHS = + +# Additional paths to look for system headers. These use the form +# "#include
". Directories that contain the files in SRCS are +# NOT auto-included here. +SYSTEM_INCLUDE_PATHS = /system/develop/headers/private/shared/ + +# Additional paths paths to look for local headers. These use the form +# #include "header". Directories that contain the files in SRCS are +# automatically included. +LOCAL_INCLUDE_PATHS = + +# Specify the level of optimization that you want. Specify either NONE (O0), +# SOME (O1), FULL (O2), or leave blank (for the default optimization level). +OPTIMIZE := + +# Specify the codes for languages you are going to support in this +# application. The default "en" one must be provided too. "make catkeys" +# will recreate only the "locales/en.catkeys" file. Use it as a template +# for creating catkeys for other languages. All localization files must be +# placed in the "locales" subdirectory. +LOCALES = + +# Specify all the preprocessor symbols to be defined. The symbols will not +# have their values set automatically; you must supply the value (if any) to +# use. For example, setting DEFINES to "DEBUG=1" will cause the compiler +# option "-DDEBUG=1" to be used. Setting DEFINES to "DEBUG" would pass +# "-DDEBUG" on the compiler's command line. +DEFINES = + +# Specify the warning level. Either NONE (suppress all warnings), +# ALL (enable all warnings), or leave blank (enable default warnings). +WARNINGS = + +# With image symbols, stack crawls in the debugger are meaningful. +# If set to "TRUE", symbols will be created. +SYMBOLS := + +# Includes debug information, which allows the binary to be debugged easily. +# If set to "TRUE", debug info will be created. +DEBUGGER := + +# Specify any additional compiler flags to be used. +COMPILER_FLAGS = -Wall -Wno-multichar -Woverloaded-virtual -Wno-unknown-pragmas -std=c++0x + +# Specify any additional linker flags to be used. +LINKER_FLAGS = + +# Specify the version of this binary. Example: +# -app 3 4 0 d 0 -short 340 -long "340 "`echo -n -e '\302\251'`"1999 GNU GPL" +# This may also be specified in a resource. +APP_VERSION := + +# (Only used when "TYPE" is "DRIVER"). Specify the desired driver install +# location in the /dev hierarchy. Example: +# DRIVER_PATH = video/usb +# will instruct the "driverinstall" rule to place a symlink to your driver's +# binary in ~/add-ons/kernel/drivers/dev/video/usb, so that your driver will +# appear at /dev/video/usb when loaded. The default is "misc". +DRIVER_PATH = + +## Include the Makefile-Engine +DEVEL_DIRECTORY := \ + $(shell findpaths -r "makefile_engine" B_FIND_PATH_DEVELOP_DIRECTORY) +include $(DEVEL_DIRECTORY)/etc/makefile-engine