Files
harbour-core/harbour/config/linux/gcc.cf
Viktor Szakats ce46f48e8c 2009-08-11 13:50 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/darwin/gcc.cf
    % Using custom LD_OUT instead of overriding while LD_RULE.

  * config/bsd/gcc.cf
  * config/wce/msvcarm.cf
  * config/wce/mingwarm.cf
  * config/wce/poccarm.cf
  * config/darwin/gcc.cf
  * config/hpux/gcc.cf
  * config/dos/watcom.cf
  * config/dos/djgpp.cf
  * config/win/watcom.cf
  * config/win/icc.cf
  * config/win/cygwin.cf
  * config/win/msvc.cf
  * config/win/xcc.cf
  * config/win/mingw.cf
  * config/win/pocc.cf
  * config/win/bcc.cf
  * config/linux/watcom.cf
  * config/linux/gcc.cf
  * config/linux/icc.cf
  * config/linux/sunpro.cf
  * config/os2/watcom.cf
  * config/os2/gcc.cf
  * config/sunos/gcc.cf
  * config/sunos/sunpro.cf
    * Cleaned LDFLAGS usage:
    % Using := instead of =
    ! Always initialize LDFLAGS to empty to prevent spillage of random values.
    * Moved lib specs included in LDFLAGS to LDLIBS.
    * Cleaned "DEBUG ALL" addition in watcom compilers.

  ; GNU Make .cf cleanup is about over. There could probably be done
    some additional optimizations, but it's already much cleaner, simpler
    and more efficient than it was until a few weeks ago.
    Still could be done: CFLAGS vs. CPPFLAGS usage accross compilers.
    *_RULE variables, revise redefinition needs, maybe change the central
    default, etc.

  * ChangeLog
    ! Typos in prev entry.
2009-08-11 12:00:07 +00:00

85 lines
1.6 KiB
CFEngine3

#
# $Id$
#
ifeq ($(HB_BUILD_MODE),cpp)
HB_CMP := g++
else
HB_CMP := gcc
endif
OBJ_EXT := .o
LIB_PREF := lib
LIB_EXT := .a
CC := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP)
CC_IN := -c
CC_OUT := -o
CPPFLAGS := -I. -I$(HB_INC_COMPILE)
CFLAGS :=
LDFLAGS :=
ifneq ($(HB_BUILD_WARN),no)
CFLAGS += -Wall -W
endif
ifneq ($(HB_BUILD_OPTIM),no)
CFLAGS += -O3
endif
# uncomment this if you want to force relocateable code for .so libs
# it's necessary on some platforms but can reduce performance
#CFLAGS += -fPIC
ifeq ($(HB_BUILD_DEBUG),yes)
CFLAGS += -g
endif
LD := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP)
LD_OUT := -o
# Add all libraries specified in LIBS.
LIBPATHS := -L$(LIB_DIR)
LDLIBS := $(foreach lib,$(LIBS),-l$(lib))
# Add the specified GT driver library and other RTLs
ifneq ($(findstring gtcrs, $(LIBS)),)
ifeq ($(HB_CRS_LIB),)
HB_CRS_LIB := ncurses
endif
LDLIBS += -l$(HB_CRS_LIB)
endif
ifneq ($(findstring gtsln, $(LIBS)),)
LDLIBS += -lslang
endif
ifneq ($(findstring gtxwc, $(LIBS)),)
LDLIBS += -lX11
#LIBPATHS += -L/usr/X11R6/lib64
LIBPATHS += -L/usr/X11R6/lib
endif
# HB_GPM_MOUSE: use gpm mouse driver
ifeq ($(HB_GPM_MOUSE),yes)
LDLIBS += -lgpm
endif
ifneq ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),)
LDLIBS += -lpcre
endif
ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),)
LDLIBS += -lz
endif
LDLIBS += -lm -lrt -ldl
LDFLAGS += $(LIBPATHS)
AR := $(HB_CCPREFIX)ar
ARFLAGS :=
AR_RULE = $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) crs $(LIB_DIR)/$@ $(^F) || ( $(RM) $(LIB_DIR)/$@ && false )
include $(TOP)$(ROOT)config/rules.cf