1997-09-16 01:07:48 +00:00
|
|
|
#
|
1997-10-29 18:46:19 +00:00
|
|
|
# brain.make
|
1997-09-16 01:07:48 +00:00
|
|
|
#
|
|
|
|
# Determine the core libraries.
|
|
|
|
#
|
|
|
|
# Copyright (C) 1997 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# Author: Scott Christley <scottc@net-community.com>
|
|
|
|
#
|
|
|
|
# This file is part of the GNUstep Makefile Package.
|
|
|
|
#
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public
|
|
|
|
# License along with this library; see the file COPYING.LIB.
|
|
|
|
# If not, write to the Free Software Foundation,
|
|
|
|
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
1997-10-28 02:34:11 +00:00
|
|
|
# Handle abbreviations for library combinations
|
1998-07-31 14:57:41 +00:00
|
|
|
|
|
|
|
ifdef library_combo
|
|
|
|
the_library_combo=$(library_combo)
|
|
|
|
else
|
|
|
|
the_library_combo=$(default_library_combo)
|
|
|
|
endif
|
|
|
|
|
1997-10-28 19:00:28 +00:00
|
|
|
ifeq ($(library_combo),nx)
|
1997-10-28 02:34:11 +00:00
|
|
|
the_library_combo=nx-nx-nx-nil
|
|
|
|
endif
|
|
|
|
|
1997-10-28 19:00:28 +00:00
|
|
|
ifeq ($(library_combo),gnu-xdps)
|
1997-10-28 02:34:11 +00:00
|
|
|
the_library_combo=gnu-gnu-gnu-xdps
|
|
|
|
endif
|
|
|
|
|
1997-10-28 19:00:28 +00:00
|
|
|
ifeq ($(library_combo),fd-xdps)
|
1997-10-28 02:34:11 +00:00
|
|
|
the_library_combo=gnu-fd-gnu-xdps
|
|
|
|
endif
|
|
|
|
|
1998-06-17 14:50:36 +00:00
|
|
|
ifeq ($(library_combo),gnu-xraw)
|
|
|
|
the_library_combo=gnu-gnu-gnu-xraw
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(library_combo),fd-xraw)
|
|
|
|
the_library_combo=gnu-fd-gnu-xraw
|
|
|
|
endif
|
|
|
|
|
1997-10-28 02:34:11 +00:00
|
|
|
ifeq ($(the_library_combo),)
|
1997-10-28 19:00:28 +00:00
|
|
|
the_library_combo=$(library_combo)
|
1997-10-28 02:34:11 +00:00
|
|
|
endif
|
|
|
|
|
1998-05-28 06:56:11 +00:00
|
|
|
ifeq ($(gc), yes)
|
|
|
|
the_library_combo := $(the_library_combo)-gc
|
|
|
|
endif
|
1997-10-28 02:34:11 +00:00
|
|
|
|
1997-09-16 01:07:48 +00:00
|
|
|
# Strip out the individual libraries from the combo string
|
1997-10-28 02:34:11 +00:00
|
|
|
combo_list = $(subst -, ,$(the_library_combo))
|
1997-09-16 01:07:48 +00:00
|
|
|
OBJC_RUNTIME_LIB = $(word 1,$(combo_list))
|
|
|
|
FOUNDATION_LIB = $(word 2,$(combo_list))
|
|
|
|
GUI_LIB = $(word 3,$(combo_list))
|
|
|
|
GUI_BACKEND_LIB = $(word 4,$(combo_list))
|
|
|
|
|
1997-10-02 00:41:03 +00:00
|
|
|
#
|
|
|
|
# Allow user specify the runtime, foundation, gui and backend libraries in
|
|
|
|
# separate variables.
|
|
|
|
#
|
|
|
|
ifneq ($(runtime),)
|
|
|
|
OBJC_RUNTIME_LIB = $(runtime)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(foundation),)
|
|
|
|
FOUNDATION_LIB = $(foundation)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(gui),)
|
|
|
|
GUI_LIB = $(gui)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(backend),)
|
|
|
|
GUI_BACKEND_LIB = $(backend)
|
|
|
|
endif
|
|
|
|
|
1998-05-28 06:56:11 +00:00
|
|
|
ifeq ($(gc), yes)
|
|
|
|
export LIBRARY_COMBO = $(OBJC_RUNTIME_LIB)-$(FOUNDATION_LIB)-$(GUI_LIB)-$(GUI_BACKEND_LIB)-gc
|
|
|
|
else
|
1997-11-01 22:41:39 +00:00
|
|
|
export LIBRARY_COMBO = $(OBJC_RUNTIME_LIB)-$(FOUNDATION_LIB)-$(GUI_LIB)-$(GUI_BACKEND_LIB)
|
1998-05-28 06:56:11 +00:00
|
|
|
endif
|
1997-09-18 01:36:07 +00:00
|
|
|
|
|
|
|
OBJC_LDFLAGS =
|
|
|
|
OBJC_LIBS =
|
|
|
|
#
|
1997-10-02 00:41:03 +00:00
|
|
|
# Set the appropriate ObjC runtime library and other information
|
1997-09-18 01:36:07 +00:00
|
|
|
#
|
1997-10-07 23:27:51 +00:00
|
|
|
ifeq ($(OBJC_RUNTIME_LIB), gnu)
|
1997-09-18 01:36:07 +00:00
|
|
|
OBJC_LDFLAGS =
|
|
|
|
OBJC_LIB_DIR =
|
|
|
|
OBJC_LIBS = -lobjc
|
1997-10-02 00:41:03 +00:00
|
|
|
OBJC_RUNTIME = GNU
|
|
|
|
RUNTIME_DEFINE = -DGNU_RUNTIME=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OBJC_RUNTIME_LIB), nx)
|
|
|
|
OBJC_RUNTIME = NeXT
|
|
|
|
RUNTIME_DEFINE = -DNeXT_RUNTIME=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OBJC_RUNTIME_LIB), sun)
|
|
|
|
OBJC_RUNTIME = Sun
|
|
|
|
RUNTIME_DEFINE = -DSun_RUNTIME=1
|
1997-09-18 01:36:07 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
FND_LDFLAGS =
|
|
|
|
FND_LIBS =
|
|
|
|
#
|
|
|
|
# Set the appropriate Foundation library
|
|
|
|
#
|
|
|
|
ifeq ($(FOUNDATION_LIB),gnu)
|
|
|
|
FND_LDFLAGS =
|
|
|
|
FND_LIBS = -lgnustep-base
|
1997-10-02 00:41:03 +00:00
|
|
|
FND_DEFINE = -DGNUSTEP_BASE_LIBRARY=1
|
1997-09-18 01:36:07 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(FOUNDATION_LIB),fd)
|
1998-02-06 19:15:05 +00:00
|
|
|
-include $(GNUSTEP_MAKEFILES)/libFoundation.make
|
1998-05-28 06:56:11 +00:00
|
|
|
|
|
|
|
FND_DEFINE = -DLIB_FOUNDATION_LIBRARY=1
|
1997-09-18 01:36:07 +00:00
|
|
|
FND_LDFLAGS =
|
1998-02-09 10:13:03 +00:00
|
|
|
FND_LIBS = -lFoundation
|
1998-05-28 06:56:11 +00:00
|
|
|
|
|
|
|
# If gc=yes was passed and libFoundation was compiled with Boehm's
|
|
|
|
# GC support, use the appropriate libraries
|
|
|
|
|
|
|
|
ifeq ($(gc), yes)
|
|
|
|
ifeq ($(LIBFOUNDATION_WITH_GC), yes)
|
|
|
|
OBJC_LIBS = -lobjc_gc $(LIBFOUNDATION_GC_LIBRARY)
|
|
|
|
AUXILIARY_CPPFLAGS += -DLIB_FOUNDATION_BOEHM_GC=1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
1997-09-18 01:36:07 +00:00
|
|
|
endif
|
|
|
|
|
1997-09-26 01:16:38 +00:00
|
|
|
ifeq ($(FOUNDATION_LIB),nx)
|
1997-11-13 03:18:16 +00:00
|
|
|
FND_LDFLAGS =
|
|
|
|
FND_LIBS = -framework Foundation
|
1997-10-25 03:53:00 +00:00
|
|
|
FND_DEFINE = -DNeXT_Foundation_LIBRARY=1
|
1997-10-02 00:41:03 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(FOUNDATION_LIB), sun)
|
|
|
|
FND_DEFINE = -DSun_Foundation_LIBRARY=1
|
|
|
|
endif
|
|
|
|
|
1997-09-18 01:36:07 +00:00
|
|
|
GUI_LDFLAGS =
|
|
|
|
GUI_LIBS =
|
|
|
|
#
|
|
|
|
# Set the GUI library
|
|
|
|
#
|
|
|
|
ifeq ($(GUI_LIB),gnu)
|
|
|
|
GUI_LDFLAGS =
|
1998-05-13 20:56:38 +00:00
|
|
|
GUI_LIBS = -lgnustep-gui -lgmodel -lgnustep-gui
|
1997-11-14 19:45:02 +00:00
|
|
|
GUI_DEFINE = -DGNU_GUI_LIBRARY=1
|
1997-09-18 01:36:07 +00:00
|
|
|
endif
|
|
|
|
|
1997-09-26 01:16:38 +00:00
|
|
|
ifeq ($(GUI_LIB),nx)
|
1997-11-14 19:45:02 +00:00
|
|
|
GUI_DEFINE = -DNeXT_GUI_LIBRARY=1
|
1997-11-13 03:18:16 +00:00
|
|
|
ifneq ($(INTERNAL_app_NAME),)
|
1997-10-14 22:54:35 +00:00
|
|
|
# If we're building an application pass the following additional flags to
|
|
|
|
# the linker
|
1997-11-13 03:18:16 +00:00
|
|
|
GUI_LDFLAGS = -sectcreate __ICON __header $(INTERNAL_app_NAME).iconheader \
|
1997-10-15 22:45:58 +00:00
|
|
|
-segprot __ICON r r -sectcreate __ICON app /NextLibrary/Frameworks/AppKit.framework/Resources/NSDefaultApplicationIcon.tiff \
|
1997-11-13 03:18:16 +00:00
|
|
|
-framework AppKit
|
|
|
|
GUI_LIBS =
|
1997-10-14 22:54:35 +00:00
|
|
|
endif
|
1997-09-26 01:16:38 +00:00
|
|
|
endif
|
|
|
|
|
1997-09-18 01:36:07 +00:00
|
|
|
BACKEND_LDFLAGS =
|
|
|
|
BACKEND_LIBS =
|
|
|
|
#
|
|
|
|
# Set the GUI Backend library
|
|
|
|
#
|
1997-10-28 02:34:11 +00:00
|
|
|
ifeq ($(GUI_BACKEND_LIB),xdps)
|
1997-09-18 01:36:07 +00:00
|
|
|
BACKEND_LDFLAGS =
|
|
|
|
BACKEND_LIBS = -lgnustep-xdps
|
1997-11-14 19:45:02 +00:00
|
|
|
BACKEND_DEFINE = -DXDPS_BACKEND_LIBRARY=1
|
1997-09-18 01:36:07 +00:00
|
|
|
endif
|
|
|
|
|
1998-06-17 14:50:36 +00:00
|
|
|
ifeq ($(GUI_BACKEND_LIB),xraw)
|
|
|
|
BACKEND_LDFLAGS =
|
|
|
|
BACKEND_LIBS = -lgnustep-xraw
|
|
|
|
BACKEND_DEFINE = -DXRAW_BACKEND_LIBRARY=1
|
|
|
|
endif
|
|
|
|
|
1997-09-18 01:36:07 +00:00
|
|
|
ifeq ($(GUI_BACKEND_LIB),w32)
|
|
|
|
BACKEND_LDFLAGS =
|
|
|
|
BACKEND_LIBS = -lMBKit
|
|
|
|
endif
|
|
|
|
|
|
|
|
SYSTEM_INCLUDES =
|
|
|
|
SYSTEM_LDFLAGS =
|
|
|
|
SYSTEM_LIB_DIR =
|
|
|
|
SYSTEM_LIBS =
|
|
|
|
#
|
|
|
|
# If the backend GUI library is X based
|
|
|
|
# then add X headers and libraries
|
|
|
|
#
|
1997-10-28 02:34:11 +00:00
|
|
|
ifeq ($(GUI_BACKEND_LIB),xdps)
|
1997-09-18 01:36:07 +00:00
|
|
|
SYSTEM_INCLUDES = $(X_INCLUDE)
|
|
|
|
SYSTEM_LDFLAGS =
|
|
|
|
SYSTEM_LIB_DIR = $(X_LIBS)
|
|
|
|
SYSTEM_LIBS = -ltiff -ldpstk -ldps -lpsres -lX11
|
|
|
|
endif
|
|
|
|
|
1998-06-17 14:50:36 +00:00
|
|
|
#
|
|
|
|
# If the backend GUI library is X (only) based
|
|
|
|
# then add X headers and libraries
|
|
|
|
#
|
|
|
|
ifeq ($(GUI_BACKEND_LIB),xraw)
|
|
|
|
SYSTEM_INCLUDES = $(X_INCLUDE)
|
|
|
|
SYSTEM_LDFLAGS =
|
|
|
|
SYSTEM_LIB_DIR = $(X_LIBS)
|
1998-08-04 12:33:34 +00:00
|
|
|
SYSTEM_LIBS = -ltiff -ldps -lpsres -lX11
|
1998-06-17 14:50:36 +00:00
|
|
|
endif
|
|
|
|
|
1997-09-18 01:36:07 +00:00
|
|
|
#
|
|
|
|
# If the backend GUI library is Win32 based
|
|
|
|
# then add Win32 headers and libraries
|
|
|
|
#
|
|
|
|
ifeq ($(GUI_BACKEND_LIB),w32)
|
|
|
|
SYSTEM_INCLUDES =
|
|
|
|
SYSTEM_LDFLAGS =
|
|
|
|
SYSTEM_LIB_DIR =
|
|
|
|
SYSTEM_LIBS = -ltiff -lwsock32 -ladvapi32 -lcomctl32 -luser32 \
|
|
|
|
-lgdi32 -lcomdlg32
|
|
|
|
endif
|
1998-05-28 06:56:11 +00:00
|
|
|
|
|
|
|
## Local variables:
|
|
|
|
## mode: makefile
|
|
|
|
## End:
|