discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Determine library script


From: Christopher Armstrong
Subject: Determine library script
Date: Sat, 22 Jul 2006 15:40:30 +1000

Hi all

Find below a useful script for compiling against libraries. I find when
I'm doing library development, I need to change between debug and
release targets, or static and shared library targets. Below is
something useful to determine the name of a library you are linking
against in your project directories at compile time.

For example, if you have a library called "abc" that you want to link
against in a test program called "mytest" you would do something like:

TOOL_NAME = mytest
ADDITIONAL_LIB_DIRS+= -L../abc/$(LIB_COMPDIR)
ADDITIONAL_TOOL_LIBS+= -labc$(LIB_SUFFIX)

I couldn't find any equivalent in the gnustep-make package, so I hope
people find this useful.

Regards
Chris

---
# Determine library script
#
# Copyright (C) Christopher Armstrong, 2006
#
# This programme is provided "AS IS", without any express or implied 
# warranty. In no event will the author be held liable for any damages
# arising out of the use of this software.
#
# Permission is granted to use this software for any purpose and may
# be modified and altered and distributed freely, provided that the
# origin of the software is not misrepresented, and that this
# notice is included with any source distribution of the software.
#
# This makefile helps you detect what type of library and debug mode is
# used when you include a library in an aggregate. Useful for testing
all
# the available library and debug mode combinations.

LIB_SUFFIX=
LIB_COMPDIR=
ifeq ($(shared),yes)
        ifeq ($(debug),yes)
          LIB_SUFFIX=_d
                LIB_COMPDIR=shared_debug_obj
        else
                LIB_SUFFIX=
                LIB_COMPDIR=shared_obj
        endif
else
  ifeq ($(debug),yes)
                LIB_SUFFIX=_ds
                LIB_COMPDIR=static_debug_obj
        else
                LIB_SUFFIX=_s
                LIB_COMPDIR=static_obj
        endif
endif
--
-- 
  Christopher Armstrong
  carmstrong@fastmail.com.au

-- 
http://www.fastmail.fm - I mean, what is it about a decent email service?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]