2007-07-18 17:21:52 +04:00
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
# Part of Equinox Desktop Environment (EDE).
|
|
|
|
# Copyright (c) 2000-2007 EDE Authors.
|
|
|
|
#
|
|
|
|
# This program is licensed under terms of the
|
|
|
|
# GNU General Public License version 2 or newer.
|
|
|
|
# See COPYING for details.
|
|
|
|
|
|
|
|
# MakeProgramPrivate [target] : [sources] : [libraries] : [flags] ;
|
|
|
|
rule MakeProgramPrivate
|
|
|
|
{
|
|
|
|
local target objects ;
|
|
|
|
|
2007-07-20 19:48:49 +04:00
|
|
|
# If this is gristed, targets of LinkAgainst, SharedLibrary and SharedLibraryVersioned
|
|
|
|
# _must_ be too. As I could see, in Jambase target is not gristed.
|
|
|
|
# I'm not sure what for cases foo/foo, but for now, things looking very good.
|
|
|
|
# target = $(1:G=$(SOURCE_GRIST)) ;
|
|
|
|
|
|
|
|
target = $(1) ;
|
2007-07-18 17:21:52 +04:00
|
|
|
|
|
|
|
# so 'jam foo' works when 'foo' is final executable
|
|
|
|
if $(target) != $(<) {
|
2007-09-28 18:08:59 +04:00
|
|
|
LocalDepends $(<) : $(target) ;
|
2007-07-18 17:21:52 +04:00
|
|
|
NotFile $(<) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
objects = [ FGristFiles $(2:S=$(SUFOBJ)) ] ;
|
|
|
|
|
|
|
|
# Pick up values if someone set flags outside (via ObjectCcFlags and etc.)
|
2011-10-07 02:19:03 +04:00
|
|
|
CCFLAGS on $(objects) = [ on $(objects) return $(CCFLAGS) ] -DE_LOG_DOMAIN="\\\"$(target)\\\"" $(4) ;
|
|
|
|
C++FLAGS on $(objects) = [ on $(objects) return $(C++FLAGS) ] -DE_LOG_DOMAIN="\\\"$(target)\\\"" $(4) ;
|
2007-07-18 17:21:52 +04:00
|
|
|
|
2008-08-10 22:18:16 +04:00
|
|
|
if $(REMOVE_UNUSED_DEPENDENCIES_TRICK) = 1 {
|
|
|
|
# remove unused dependencies in binaries, as U.Drepper prescribed ;-)
|
|
|
|
LINKFLAGS on $(target) = -Wl,--as-needed [ on $(target) return $(LINKFLAGS) ] ;
|
|
|
|
}
|
|
|
|
|
2007-07-18 17:21:52 +04:00
|
|
|
LINKLIBS on $(target) = $(3) [ on $(target) return $(LINKLIBS) ] ;
|
|
|
|
|
|
|
|
MainFromObjects $(target) : $(objects) ;
|
|
|
|
Objects $(>) ;
|
|
|
|
}
|
|
|
|
|
2007-07-20 19:48:49 +04:00
|
|
|
# LinkAgainst [taraget] : [libraries] ;
|
|
|
|
# Add [libraries] to list of libraries for linking with [taraget]. This
|
|
|
|
# rule is similar to jam's LinkLibraries, but it will not built those libraries
|
|
|
|
# nor marked them for building. Also requires [libraries] are in the form '-lfoo'.
|
|
|
|
rule LinkAgainst
|
|
|
|
{
|
|
|
|
# Here is not used grist on target (LinkLibraries does not use it too).
|
|
|
|
# If gristing is added, make shure is added to SharedLibrary and SharedLibraryVersioned
|
|
|
|
# or it will not pick libraries and symlink will not be created.
|
|
|
|
LINKLIBS on $(1) = [ on $(1) return $(LINKLIBS) ] $(2) ;
|
|
|
|
}
|
|
|
|
|
2008-08-25 17:24:16 +04:00
|
|
|
# LinkAgainstAsFirst [taraget] : [libraries] ;
|
|
|
|
# The same as LinkAgainst, except [libraries] will be placed before other libraries.
|
|
|
|
rule LinkAgainstAsFirst
|
|
|
|
{
|
|
|
|
LINKLIBS on $(1) = $(2) [ on $(1) return $(LINKLIBS) ] ;
|
|
|
|
}
|
|
|
|
|
2007-07-20 19:48:49 +04:00
|
|
|
# Program [target] : [sources] ;
|
2007-07-18 17:21:52 +04:00
|
|
|
# Compiles and links [target] from [sources]. No external flags or
|
|
|
|
# libraries are used since this should be generic rule for compiling
|
|
|
|
# any program.
|
|
|
|
rule Program
|
|
|
|
{
|
2007-07-20 19:48:49 +04:00
|
|
|
Main $(1) : $(2) ;
|
2007-07-18 17:21:52 +04:00
|
|
|
}
|
|
|
|
|
2007-07-20 19:48:49 +04:00
|
|
|
# EdeProgram [target] : [sources] : [noinstall] ;
|
2007-07-18 17:21:52 +04:00
|
|
|
# Creates EDE specific programs. They will be linked with EDELIBLIB
|
2007-07-20 19:48:49 +04:00
|
|
|
# and FLTKLIB. If [noinstall] is given, [target] will not be installed wit 'jam install'.
|
2007-07-18 17:21:52 +04:00
|
|
|
rule EdeProgram
|
|
|
|
{
|
2009-10-13 18:50:55 +04:00
|
|
|
if ! $(EDELIBLIB) {
|
|
|
|
Echo "EDELIBLIB not defined; $(1) will not be built" ;
|
2007-07-18 17:21:52 +04:00
|
|
|
return ;
|
|
|
|
}
|
|
|
|
|
|
|
|
MakeProgramPrivate $(1) : $(2)
|
2009-05-14 20:06:10 +04:00
|
|
|
: $(EDELIB_GUI_LIB) $(EDELIBLIB) $(FLTKLIB) $(STDLIB)
|
2007-07-20 19:48:49 +04:00
|
|
|
: $(GLOBALFLAGS) $(EDELIBINCLUDE) $(FLTKINCLUDE) ;
|
2007-07-18 20:14:10 +04:00
|
|
|
|
2007-07-20 19:48:49 +04:00
|
|
|
if $(3) != "noinstall" {
|
2007-07-18 20:14:10 +04:00
|
|
|
InstallEdeProgram $(1) ;
|
|
|
|
}
|
2007-07-18 17:21:52 +04:00
|
|
|
}
|
|
|
|
|
2009-03-06 15:43:03 +03:00
|
|
|
# EdeProgramAsFltkBare [target] : [sources] : [noinstall] ;
|
2009-03-06 15:12:27 +03:00
|
|
|
# Creates EDE specific programs. They will be linked with EDELIBLIB
|
|
|
|
# and FLTKLIB. If [noinstall] is given, [target] will not be installed wit 'jam install'.
|
2009-03-06 15:43:03 +03:00
|
|
|
rule EdeProgramAsFltkBare
|
2009-03-06 15:12:27 +03:00
|
|
|
{
|
2009-10-13 18:50:55 +04:00
|
|
|
if ! $(EDELIBLIB) {
|
|
|
|
Echo "EDELIBLIB not defined; $(1) will not be built" ;
|
2009-03-06 15:12:27 +03:00
|
|
|
return ;
|
|
|
|
}
|
|
|
|
|
|
|
|
MakeProgramPrivate $(1) : $(2)
|
2009-05-14 20:06:10 +04:00
|
|
|
: $(EDELIB_GUI_LIB) $(EDELIBLIB) $(FLTKLIB_NOIMAGES) $(STDLIB)
|
2009-03-06 15:12:27 +03:00
|
|
|
: $(GLOBALFLAGS) $(EDELIBINCLUDE) $(FLTKINCLUDE) ;
|
|
|
|
|
|
|
|
if $(3) != "noinstall" {
|
|
|
|
InstallEdeProgram $(1) ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-20 19:48:49 +04:00
|
|
|
# EfltkProgram [target] : [sources] : [noinstall] ;
|
|
|
|
# Creates programs that will be linked with efltk. If [noinstall] is given,
|
|
|
|
# [target] will not be installed wit 'jam install'.
|
2007-07-18 17:21:52 +04:00
|
|
|
rule EfltkProgram
|
|
|
|
{
|
|
|
|
if ! $(EFLTKINCLUDE) || ! $(EFLTKLIB) {
|
|
|
|
Echo "EFLTKINCLUDE or EFLTKLIB not defined; $(1) will not be built" ;
|
|
|
|
return ;
|
|
|
|
}
|
|
|
|
|
|
|
|
MakeProgramPrivate $(1) : $(2)
|
2007-07-20 19:48:49 +04:00
|
|
|
: $(EFLTKLIB) $(STDLIB)
|
|
|
|
: $(GLOBALFLAGS) $(EFLTKINCLUDE) ;
|
2007-07-18 20:14:10 +04:00
|
|
|
|
|
|
|
# install it where ede binaries resides
|
2007-07-20 19:48:49 +04:00
|
|
|
if $(3) != "noinstall" {
|
2007-07-18 20:14:10 +04:00
|
|
|
InstallEdeProgram $(1) ;
|
|
|
|
}
|
2007-07-18 17:21:52 +04:00
|
|
|
}
|
|
|
|
|
2007-07-20 19:48:49 +04:00
|
|
|
# FltkProgram [target] : [sources] : [noinstall] ;
|
2007-07-18 17:21:52 +04:00
|
|
|
# Creates programs that will be linked with fltk only. It will use full fltk
|
|
|
|
# dependencies (images).
|
|
|
|
rule FltkProgram
|
|
|
|
{
|
|
|
|
if ! $(FLTKINCLUDE) || ! $(FLTKLIB) {
|
|
|
|
Echo "FLTKINCLUDE or FLTKLIB not defined; $(1) will not be built" ;
|
|
|
|
return ;
|
|
|
|
}
|
|
|
|
|
|
|
|
MakeProgramPrivate $(1) : $(2)
|
2007-07-20 19:48:49 +04:00
|
|
|
: $(FLTKLIB) $(STDLIB)
|
|
|
|
: $(GLOBALFLAGS) $(FLTKINCLUDE) ;
|
2007-07-18 20:14:10 +04:00
|
|
|
|
|
|
|
# install it where ede binaries resides
|
2007-07-20 19:48:49 +04:00
|
|
|
if $(3) != "noinstall" {
|
2007-07-18 20:14:10 +04:00
|
|
|
InstallEdeProgram $(1) ;
|
|
|
|
}
|
2007-07-18 17:21:52 +04:00
|
|
|
}
|
|
|
|
|
2007-07-20 19:48:49 +04:00
|
|
|
# FltkProgramBare [target] : [sources] : [noinstall] ;
|
2007-07-18 17:21:52 +04:00
|
|
|
# Creates programs that will be linked with fltk only. No images will be linked in it.
|
|
|
|
rule FltkProgramBare
|
|
|
|
{
|
|
|
|
if ! $(FLTKINCLUDE) || ! $(FLTKLIB_NOIMAGES) {
|
|
|
|
Echo "FLTKINCLUDE or FLTKLIB_NOIMAGES not defined; $(1) will not be built" ;
|
|
|
|
return ;
|
|
|
|
}
|
|
|
|
|
|
|
|
MakeProgramPrivate $(1) : $(2)
|
2007-07-20 19:48:49 +04:00
|
|
|
: $(FLTKLIB_NOIMAGES) $(STDLIB)
|
|
|
|
: $(GLOBALFLAGS) $(FLTKINCLUDE) ;
|
2007-07-18 20:14:10 +04:00
|
|
|
|
|
|
|
# install it where ede binaries resides
|
2007-07-20 19:48:49 +04:00
|
|
|
if $(3) != "noinstall" {
|
2007-07-18 20:14:10 +04:00
|
|
|
InstallEdeProgram $(1) ;
|
|
|
|
}
|
2007-07-18 17:21:52 +04:00
|
|
|
}
|
2008-01-14 15:02:43 +03:00
|
|
|
|
|
|
|
# ProgramBare [target] : [sources] : [noinstall] ;
|
|
|
|
# Creates programs that will be linked only with standard library (no FLTK and X11 libraries).
|
|
|
|
# This rule is usefull for creating command line programs that should be installed at the same
|
|
|
|
# place where other EDE programs are installed.
|
|
|
|
rule ProgramBare
|
|
|
|
{
|
|
|
|
MakeProgramPrivate $(1) : $(2)
|
|
|
|
: $(STDLIB)
|
|
|
|
: $(GLOBALFLAGS) ;
|
|
|
|
|
|
|
|
# install it where ede binaries resides
|
|
|
|
if $(3) != "noinstall" {
|
|
|
|
InstallEdeProgram $(1) ;
|
|
|
|
}
|
|
|
|
}
|