Skip to content

Commit

Permalink
Fix paths to header files in generated Makefiles (#20)
Browse files Browse the repository at this point in the history
* Update paths #1

* Update path #2

* Update path #3

* Update path #4

* Update path #5

* Update path #6

* Update path #7

* Update path #8

* Update path #9

* Haiku specific (1)

* Haiku specific (2)

* Update makefile template

* Get rid of the "more information" part

I noticed that the makefile template was already updated to v2.6

* Delete an unnecessary path (?)

* Change indentation

* Change indentation (2)

* Get rid of "ifdef"

* Get rid of "ifdef" (2)

* Use B_SYSTEM_HEADERS_DIRECTORY

* Comment out conflicting library
  • Loading branch information
BachToTheFuture authored and scottmc committed Jan 13, 2018
1 parent 677709e commit 7371fd5
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 36 deletions.
6 changes: 3 additions & 3 deletions Documentation/Paladin Documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ <h2 id="using-system-libraries" style="margin-top: 20px;">Using System Libraries
<img src="images/LibraryWindow.png" alt="Library window" style="float: right; padding-left: 9px;">
<p>One notable deviation from BeIDE's workflow is how Paladin works with
libraries installed in the usual system locations, i.e. <code>
/boot/home/config/lib</code> and <code>/boot/develop/lib/x86</code>. Libraries
/boot/home/config/lib</code> and <code>/boot/system/develop/lib/x86</code>. Libraries
found here are added using a separate window. The Libraries window can be
found by choosing Change System Libraries from the Project menu.</p>
<p>Instead of having to manually add system libraries to your project by the
same means as all of your other files, all that is needed is to check the
entry for a particular library you wish to be linked into your project. They
are listed and grouped by order of location – all libraries kept in <code>
/boot/develop/lib/x86</code> are listed first group and those stored in <code>
/boot/system/develop/lib/x86</code> are listed first group and those stored in <code>
/boot/home/config/lib</code> are listed further down in the second group.
Under Haiku, three groups are used, and libraries found in <code>
/boot/common/lib</code> are listed in between the other two groups.</p>
Expand Down Expand Up @@ -358,7 +358,7 @@ <h2 id="adding-your-own-project-templates" style="margin-top: 5px;">Adding Your
will become the basis for your project template.</li>
<li>Rename the project's folder to the name you wish to use for the template.</li>
<li>Move the project folder to the Templates folder where Paladin is
installed. This is usually <code>/boot/apps/Paladin</code> or something
installed. This is usually <code>/boot/system/apps/Paladin</code> or something
similar.</li>
</ol>
Once you have finished this series of steps, the next time you start Paladin,
Expand Down
2 changes: 1 addition & 1 deletion Documentation/ProjectFileFormat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ DEPENDENCY This is an optional field. It is a list of files separated by
LOCALINCLUDE Include path for headers and libraries. Source files depend
on these to be able to find their headers.
SYSTEMINCLUDE System folders which are used for includes. This is typically
for headers in the /boot/develop/headers folder hierarchy
for headers in the /boot/system/develop/headers folder hierarchy
LIBRARY A library. Note that this is not limited to shared libraries
in the standard locations, but any library, including static
libraries kept in the project folder or anywhere else.
Expand Down
9 changes: 6 additions & 3 deletions Paladin/FindOpenFileWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,12 @@ FindOpenFileWindow::MessageReceived(BMessage* message)

if (fSystemCheckBox->Value() == B_CONTROL_OFF)
findmessage.AddString("folder", gCurrentProject->GetPath().GetFolder());

findmessage.AddString("folder","/boot/develop/headers");


BPath sysDevPath;
find_directory(B_SYSTEM_DEVELOP_DIRECTORY, &sysDevPath, false);
sysDevPath.Append("/headers");
findmessage.AddString("folder", sysDevPath.Path());

DPath path(B_USER_CONFIG_DIRECTORY);
path << "include";
findmessage.AddString("folder", path.GetFullPath());
Expand Down
2 changes: 1 addition & 1 deletion Paladin/LibWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ LibraryWindow::MessageReceived(BMessage* message)
}

// We're not using the ref's path to preserve symlinked folder
// names in the /boot/develop hierarchy.
// names in the /boot/system/develop hierarchy.
// Both Haiku and Zeta do this.
BPath path(pathString.String());
path.Append(ref.name);
Expand Down
2 changes: 1 addition & 1 deletion Paladin/Makefile.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* 5. Paste it into here.
*/

const char* template_makefile = "## Haiku Generic Makefile ##\n\
const char* template_makefile = "## Haiku Generic Makefile v2.6 ##\n\
\n\
## Fill in this file to specify the project being created, and the referenced\n\
## Makefile-Engine will do all of the hard work for you. This handles any\n\
Expand Down
6 changes: 3 additions & 3 deletions Paladin/Paladin.pld
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ SOURCEFILE=CHANGES
LOCALINCLUDE=BuildSystem
LOCALINCLUDE=ThirdParty
LOCALINCLUDE=SourceControl
SYSTEMINCLUDE=/boot/develop/headers/be
SYSTEMINCLUDE=/boot/develop/headers/cpp
SYSTEMINCLUDE=/boot/develop/headers/posix
SYSTEMINCLUDE=/boot/system/develop/headers/be
SYSTEMINCLUDE=/boot/system/develop/headers/cpp
SYSTEMINCLUDE=/boot/system/develop/headers/posix
SYSTEMINCLUDE=/boot/home/config/include
LIBRARY=/boot/system/lib/libroot.so
LIBRARY=/boot/system/lib/libbe.so
Expand Down
32 changes: 22 additions & 10 deletions Paladin/Project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1346,25 +1346,37 @@ Project::CreateProject(const char *projname, const char *target, int32 type, con

newproj->SetTargetType(type);

newproj->AddLocalInclude(".");
newproj->AddSystemInclude("/boot/develop/headers/be");
newproj->AddSystemInclude("/boot/develop/headers/cpp");
newproj->AddSystemInclude("/boot/develop/headers/posix");
newproj->AddSystemInclude("/boot/home/config/include");
BPath sysDevPath;
find_directory(B_SYSTEM_HEADERS_DIRECTORY, &sysDevPath, false);
char temp[PATH_MAX];
strcpy(temp, sysDevPath.Path());

newproj->AddLibrary("/boot/develop/lib/x86/libroot.so");
newproj->AddLocalInclude(".");
newproj->AddSystemInclude(strcat(temp, "/be"));
strcpy(temp, sysDevPath.Path());
newproj->AddSystemInclude(strcat(temp, "/cpp"));
strcpy(temp, sysDevPath.Path());
newproj->AddSystemInclude(strcat(temp, "/posix"));
strcpy(temp, sysDevPath.Path());
sysDevPath.GetParent(&sysDevPath);
strcpy(temp, sysDevPath.Path());
//I don't think "/boot/home/config/include" exists in Haiku
//newproj->AddSystemInclude("/boot/home/config/include");

//The following library messes the build :(
//newproj->AddLibrary(strcat(temp, "/lib/x86/libroot.so"));
newproj->AddGroup("Source files");

switch (type)
{
case PROJECT_GUI:
{
newproj->AddLibrary("/boot/develop/lib/x86/libbe.so");

// Having to manually add this one is terribly annoying. :/
if (DetectPlatform() == PLATFORM_HAIKU_GCC4)
newproj->AddLibrary("/boot/develop/lib/x86/libsupc++.so");
if (DetectPlatform() == PLATFORM_HAIKU_GCC4){
newproj->AddLibrary("/boot/system/develop/lib/x86/libbe.so");
newproj->AddLibrary("/boot/system/develop/lib/x86/libsupc++.so");
}
else newproj->AddLibrary("/boot/develop/lib/x86/libbe.so");
break;
}
case PROJECT_DRIVER:
Expand Down
12 changes: 6 additions & 6 deletions Paladin/Templates/Tracker Addon/Tracker Addon.pld
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ GROUP=Source Files
EXPANDGROUP=yes
SOURCEFILE=TrackerAddon.cpp
SOURCEFILE=TrackerAddon.rsrc
SYSTEMINCLUDE=/boot/develop/headers/be
SYSTEMINCLUDE=/boot/develop/headers/cpp
SYSTEMINCLUDE=/boot/develop/headers/posix
SYSTEMINCLUDE=/boot/system/develop/headers/be
SYSTEMINCLUDE=/boot/system/develop/headers/cpp
SYSTEMINCLUDE=/boot/system/develop/headers/posix
SYSTEMINCLUDE=/boot/home/config/include
LIBRARY=/boot/develop/lib/x86/libroot.so
LIBRARY=/boot/develop/lib/x86/libbe.so
LIBRARY=/boot/develop/lib/x86/libsupc++.so
LIBRARY=/boot/system/develop/lib/x86/libroot.so
LIBRARY=/boot/system/develop/lib/x86/libbe.so
LIBRARY=/boot/system/develop/lib/x86/libsupc++.so
RUNARGS=
CCDEBUG=no
CCPROFILE=no
Expand Down
10 changes: 5 additions & 5 deletions Paladin/Templates/Tracker Addon/testfiles/TestProject.pld
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ GROUP=Source Files
EXPANDGROUP=yes
SOURCEFILE=TestSourceFile.cpp
LOCALINCLUDE=
SYSTEMINCLUDE=/boot/develop/headers/be
SYSTEMINCLUDE=/boot/develop/headers/cpp
SYSTEMINCLUDE=/boot/develop/headers/posix
SYSTEMINCLUDE=/boot/system/develop/headers/be
SYSTEMINCLUDE=/boot/system/develop/headers/cpp
SYSTEMINCLUDE=/boot/system/develop/headers/posix
SYSTEMINCLUDE=/boot/home/config/include
LIBRARY=/boot/develop/lib/x86/libroot.so
LIBRARY=/boot/develop/lib/x86/libbe.so
LIBRARY=/boot/system/develop/lib/x86/libroot.so
LIBRARY=/boot/system/develop/lib/x86/libbe.so
LIBRARY=/boot/system/lib/libsupc++.so
RUNARGS=
CCDEBUG=no
Expand Down
6 changes: 3 additions & 3 deletions SymbolFinder/SymbolFinder.pld
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ DEPENDENCY=DWindow.h
SOURCEFILE=MainWindow.cpp
DEPENDENCY=MainWindow.h|DPath.h
SOURCEFILE=SymbolFinder.rdef
SYSTEMINCLUDE=/boot/develop/headers/be
SYSTEMINCLUDE=/boot/develop/headers/cpp
SYSTEMINCLUDE=/boot/develop/headers/posix
SYSTEMINCLUDE=/boot/system/develop/headers/be
SYSTEMINCLUDE=/boot/system/develop/headers/cpp
SYSTEMINCLUDE=/boot/system/develop/headers/posix
SYSTEMINCLUDE=/boot/home/config/include
LIBRARY=/boot/system/lib/libroot.so
LIBRARY=/boot/system/lib/libbe.so
Expand Down

0 comments on commit 7371fd5

Please sign in to comment.