Skip to content
Snippets Groups Projects
  • Deucе's avatar
    6e69eec1
    For macOS, set install_name to @rpath/libNAME.dylib and use it · 6e69eec1
    Deucе authored
    For the SBBS binaries, set @executable_path and
    @executable_path/../${LIBODIR} so they can all be in one dir, or
    they can be in the build output dirs and still work.
    
    For utilities, set to @executable_path and
    @executable_path/../../${LIBODIR} for the same reason.
    
    With this, we shouldn't need to fiddle with DYLD_LIBRARY_PATH
    6e69eec1
    History
    For macOS, set install_name to @rpath/libNAME.dylib and use it
    Deucе authored
    For the SBBS binaries, set @executable_path and
    @executable_path/../${LIBODIR} so they can all be in one dir, or
    they can be in the build output dirs and still work.
    
    For utilities, set to @executable_path and
    @executable_path/../../${LIBODIR} for the same reason.
    
    With this, we shouldn't need to fiddle with DYLD_LIBRARY_PATH
GNUmakefile 1.60 KiB
# GNUmakefile

#########################################################################
# Makefile for Synchronet monitor for Unix								#
# For use with GNU make and GNU C Compiler or Borland Kylix C++			#
# @format.tab-size 4, @format.use-tabs true								#
#																		#
# gcc: gmake															#
# Borland (still in testing/debuging stage): gmake bcc=1				#
#																		#
# Optional build targets: dlls, utils, mono, all (default)				#
#########################################################################

# $Id: GNUmakefile,v 1.9 2020/04/30 21:26:42 deuce Exp $

SRC_ROOT	=	../..
include $(SRC_ROOT)/build/Common.gmake
include $(SRC_ROOT)/sbbs3/sbbsdefs.mk

ifeq ($(os),sunos)
 EXTRA_LIBS	+=	-lnsl
endif

vpath %.c ..

CFLAGS	+=	$(SBBSDEFS) -I.. -I../../comio $(SMBLIB_CFLAGS) $(HASH_CFLAGS) $(XPDEV-MT_CFLAGS) $(CRYPT_CFLAGS) `pkg-config gtk+-3.0 --cflags`
LDFLAGS	+=	-L../$(LIBODIR) $(SMBLIB_LDFLAGS) $(XPDEV-MT_LDFLAGS) $(MT_LDFLAGS)
EXTRA_LIBS += `pkg-config gtk+-3.0 --libs`

# Because pkg-config for libglade uses --rpath, we need to also, LD_RUN_PATH
# won't work.  :-(
ifeq ($(os),darwin)
 LDFLAGS += -Wl,$(RPATH),@executable_path,$(RPATH),@executable_path/../../$(LIBODIR)
else
 ifdef SBBSDIR
  LDFLAGS	+=	-Wl,$(RPATH),$(SBBSDIR)/exec
 endif
 PARENT_DIR = $(shell dirname `pwd`)
 LDFLAGS	+=	-Wl,$(RPATH),$(PARENT_DIR)/$(LIBODIR)
 ifeq ($(os),sunos)
  LDFLAGS	+=	-Wl,$(RPATH),/opt/sfw/gcc-3/lib
 endif
endif

$(GTKUSERLIST): $(OBJS)
	@echo Linking $@
	$(QUIET)$(CC) $(LDFLAGS) $(OBJS) -o $@ $(EXTRA_LIBS) -lsbbs $(SMBLIB_LIBS) $(XPDEV-MT_LIBS)
	$(QUIET)cd $(EXEODIR) && ln -fs ../gtkuserlist.glade .