* MakeLocateObjects: The comment implied that the supplied file names

needed to be gristed, but actually all invocations supplied ungristed
  files. The rule does add grist itself now.
* Added SharedLibraryFromObjects rule.
* Fixed a serious bug in ObjectReference.
* Added rules and variables needed for building the FreeType2 library.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1489 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2002-10-12 15:15:38 +00:00
parent 73d1e1fe5e
commit 21df594501
+79 -10
View File
@@ -561,9 +561,9 @@ rule Translator
rule MakeLocateObjects
{
# MakeLocateObjects <gristed_sources_or_objects> ;
# MakeLocateObjects <sources_or_objects> ;
local _objs = $(1:S=$(SUFOBJ)) ;
local _objs = [ FGristFiles $(1:S=$(SUFOBJ)) ] ;
for o in $(_objs)
{
@@ -587,20 +587,26 @@ rule StaticLibrary
MakeLocate lib$(<).a : $(OBOS_STLIB_DIR) ;
}
rule SharedLibrary
rule SharedLibraryFromObjects
{
# SharedLibrary <name> : <sources> ;
# SharedLibraryFromObjects <name> : <objects> ;
local _lib = lib$(1).so ;
# SetupIncludes ;
SetupObjectsDir ;
MakeLocateObjects $(2) ;
Main $(_lib) : $(2) ;
MainFromObjects $(_lib) : $(2) ;
MakeLocate $(_lib) : $(OBOS_SHLIB_DIR) ;
LINKFLAGS on $(_lib) = [ on $(_lib) return $(LINKFLAGS) ]
-nostart -Xlinker -soname=\"$(_lib)\" ;
}
rule SharedLibrary
{
# SharedLibrary <name> : <sources> ;
# SetupIncludes ;
SetupObjectsDir ;
MakeLocateObjects $(2) ;
Objects $(2) ;
SharedLibraryFromObjects $(1) : $(2:S=$(SUFOBJ)) ;
}
rule LinkSharedOSLibs
{
# LinkSharedOSLibs <name> : <libs> ;
@@ -1012,7 +1018,7 @@ rule ObjectReference
local source = $(2) ;
if $(ref) != $(source) {
Depends $(ref) : $(source) ;
on $(ref) LOCATE = [ on $(source) return $(LOCATE) ] ;
LOCATE on $(ref) = [ on $(source) return $(LOCATE) ] ;
}
}
@@ -1304,3 +1310,66 @@ actions InstallFloppy
dd if=$(2) of=$(FLOPPY_PATH) bs=18k
}
#-------------------------------------------------------------------------------
# FreeType 2 specific rules and variables
#-------------------------------------------------------------------------------
FT2_INCLUDE = [ FDirName $(OBOS_TOP) headers libs freetype2 ] ;
FT2_SRC = [ FDirName $(OBOS_TOP) src libs freetype2 ] ;
FT2_LIB = freetype ;
rule UseFreeTypeHeaders
{
SubDirHdrs $(FT2_INCLUDE) ;
}
rule UseFreeTypeObjectHeaders
{
ObjectHdrs $(1) : $(FT2_INCLUDE) ;
}
rule FT2_SubDir
{
# FT2_SubDir <dir>
# <dir>: Components of a directory in the original hierarchy.
local dir = $(1) ;
local topDir ;
switch $(dir[1])
{
case "include" : topDir = $(FT2_INCLUDE) ;
case src : topDir = $(FT2_SRC) ;
case * : ECHO "Unknown FreeType2 directory: " $(dir) ;
}
return [ FDirName $(topDir) $(dir[2-]) ] ;
}
rule FT2_Library
{
# FT2_Library <libname> : <sources>
# Builds objects from sources and adds the objects to the list of objects
# to be linked into the library.
# <libname> The name of the library.
# <sources> The sources.
local library = lib$(1).so ;
local sources = $(2) ;
SetupObjectsDir ;
MakeLocateObjects $(sources) ;
Objects $(sources) ;
LIBRARY_OBJECTS on $(library) += [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
}
rule FT2_LinkLibrary
{
# FT2_LinkLibrary <libname>
# Links the library from the objects build with FT2_LIBRARY before.
local library = lib$(1).so ;
local objects = [ on $(library) return $(LIBRARY_OBJECTS) ] ;
ObjectReferences $(objects) ;
objects = [ FGristFiles $(objects) ] ;
SharedLibraryFromObjects $(1) : $(objects) ;
}