# # FreeBSD and NetBSD specific Makefile setup # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as # published by the Free Software Foundation. You find a copy of this # license in the file COPYRIGHT in the root directory of this release. # # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, # BUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # # Description: # # This make file is included by the main Makefile on FreeBSD and NetBSD. # It sets up make variables for the FreeBSD ports collection so that # fewer adaptions are necessary. # # Authors: # Simon Barner (FreeBSD) # Mario Kemper (NetBSD adaptions) # # $Id: Makefile.bsd,v 1.4 2003/10/23 18:29:48 tom Exp tom $ # # X11BASE, LOCALBASE and PREFIX are variables used by the ports collection # Users of the ports collection may override these values => ifndef foo # Paths X11BASE ?= /usr/X11R6 LOCALBASE ?= /usr/local PREFIX ?= $(X11BASE) prefix = $(PREFIX) TK_LIBRARY_BASE = $(LOCALBASE)/lib ifeq ($(OS), FreeBSD) SYS_DBDIR = /var/tmp/nxtvdb else SYS_DBDIR = /tmp/nxtvdb endif # uncomment to force system wide db dir WANT_USER_DBDIR = 1 # other settings # On FreeBSD there is only a modified tclsh with a message to launch # tclsh8.3 or tclsh8.4 , so this is hardcoded here TCL_VER = 8.4 LDLIBS = -L$(LOCALBASE)/lib\ -L$(X11BASE)/lib\ -ltk84 -ltcl84 -lX11 -lXmu -lm INCS += -I$(LOCALBASE)/include/tcl$(TCL_VER)\ -I$(LOCALBASE)/include/tk$(TCL_VER) WANT_THREADS = 1 # comment out to force process based implementation ifeq ($(OS), FreeBSD) PTHREAD = $(PTHREAD_LIBS) else PTHREAD = -pthread endif ### Common part for all UN*X variants ### # Tools PERL ?= /usr/bin/perl CC ?= gcc ECHO ?= @echo # Paths exec_prefix = ${prefix} bindir = ${exec_prefix}/bin mandir = ${prefix}/man/man1 ifeq ($(OS), FreeBSD) resdir = ${X11BASE}/lib/X11 else resdir = $(LOCALBASE)/lib/X11 endif # other settings OPTFLAGS = -O -pipe -g # use static libraries for debugging only #LDLIBS += -Ldbglib -static INCS += -I. -I$(X11BASE)/include # path to Tcl/Tk headers, if not properly installed #INCS += -I/usr/local/tcl/tcl8.0/generic -I/usr/local/tcl/tk8.0/generic # path to Tcl/Tk script library (Tk is usually in X11/lib/tk#.#) TK_LIBRARY_PATH = $(TK_LIBRARY_BASE)/tk$(TCL_VER) TCL_LIBRARY_PATH = $(TK_LIBRARY_BASE)/tcl$(TCL_VER) DEFS += -DTK_LIBRARY_PATH=\"$(TK_LIBRARY_PATH)\" DEFS += -DTCL_LIBRARY_PATH=\"$(TCL_LIBRARY_PATH)\" DEFS += -DX11_APP_DEFAULTS=\"$(resdir)/app-defaults/Nxtvepg\" # enable use of multi-threading ifdef WANT_THREADS DEFS += -DUSE_THREADS LDLIBS += $(PTHREAD) endif # enable use of daemon and client/server connection DEFS += -DUSE_DAEMON # The database directory can be either in the user's $HOME (or relative to any # other env variable) or at a global place like /var/spool (world-writable) # -> set WANT_USER_DBDIR in OS specific part ifdef WANT_USER_DBDIR USER_DBDIR = .nxtvdb DEFS += -DEPG_DB_ENV=\"HOME\" -DEPG_DB_DIR=\"$(USER_DBDIR)\" endif ifndef USER_DBDIR DEFS += -DEPG_DB_DIR=\"$(SYS_DBDIR)\" INST_DB_DIR = $(SYS_DBDIR) INST_DB_PERM = 0777 endif WARN = -Wall -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes #WARN += -Wpointer-arith -Werror # the following flags can be overridden by an environment variable with the same name CFLAGS ?= $(OPTFLAGS) CFLAGS += $(WARN) $(INCS) $(DEFS) #LDLIBS += -pg BUILD_DIR= ${WRKSRC} all :: printconfig # this will print some information on the current configuration .PHONY: printconfig printconfig :: $(ECHO) $(ECHO) Building on $(OS)... $(ECHO) $(ECHO) " prefix: $(prefix)" $(ECHO) " tcl version: $(TCL_VER)" ifdef USER_DBDIR $(ECHO) " db in home: yes" else $(ECHO) " db in home: no" $(ECHO) " system db dir: $(SYS_DBDIR)" endif ifdef WANT_THREADS $(ECHO) " Concurrency implementation based on: threads (using $(PTHREAD))" else $(ECHO) " Concurrency implementation based on: processes" endif $(ECHO) " C compiler: $(CC)" $(ECHO) # end of BSD specific makefile # here the main Makefile continues