📄 unix.mak
字号:
## unix.mak## First part of make rules, included in ptlib.mak and pwlib.mak.# Note: Do not put any targets in the file. This should defaine variables# only, as targets are all in common.mak## Portable Windows Library## Copyright (c) 1993-1998 Equivalence Pty. Ltd.## The contents of this file are subject to the Mozilla Public License# Version 1.0 (the "License"); you may not use this file except in# compliance with the License. You may obtain a copy of the License at# http://www.mozilla.org/MPL/## Software distributed under the License is distributed on an "AS IS"# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See# the License for the specific language governing rights and limitations# under the License.## The Original Code is Portable Windows Library.## The Initial Developer of the Original Code is Equivalence Pty. Ltd.## Portions are Copyright (C) 1993 Free Software Foundation, Inc.# All Rights Reserved.# # Contributor(s): ______________________________________.## $Log: unix.mak,v $# Revision 1.83 2000/06/26 11:17:20 robertj# Nucleus++ port (incomplete).## Revision 1.82 2000/06/21 01:01:21 robertj# AIX port, thanks Wolfgang Platzer (wolfgang.platzer@infonova.at).## Revision 1.81 2000/05/18 22:23:21 rogerh# Fix RANLIB usage on the BSD machines. RANLIB can now be used to# specify the ranlib executable. P_USE_RANLIB must now be set to# enable ranlib usage.## Revision 1.80 2000/05/18 08:33:12 robertj# Added variables for standard programs ar and ranlib## Revision 1.79 2000/05/05 10:42:04 robertj# Fixed support for older FreeBSD (location of sysctrl).## Revision 1.78 2000/04/19 00:13:52 robertj# BeOS port changes.## Revision 1.77 2000/04/11 21:22:08 robertj# Made CC compiler explicitly gcc on Solaris systems.## Revision 1.76 2000/04/11 15:14:33 rogerh# Tidy up NetBSD comments## Revision 1.75 2000/04/10 16:18:16 rogerh# More NetBSD support changes## Revision 1.74 2000/04/10 11:36:16 rogerh# Add NetBSD pthreads support## Revision 1.73 2000/04/10 06:45:59 rogerh# NetBSD needs the ossaudio liobrary## Revision 1.72 2000/04/09 18:29:02 rogerh# Add my NetBSD changes## Revision 1.71 2000/04/07 06:22:33 rogerh# Add comment about the -s flag and Mac OS X## Revision 1.70 2000/04/06 20:12:33 craigs# Added install targets## Revision 1.69 2000/04/06 11:37:51 rogerh# Add MacOS X support from Kevin Packard## Revision 1.68 2000/04/03 22:31:08 rogerh# Get a more exact FreeBSD version number using a kernel sysctl## Revision 1.67 2000/03/17 03:47:00 craigs# Changed DEBUG version to always be static## Revision 1.66 2000/03/09 14:22:04 rogerh# OpenBSD requires -lossaudio for OSS Audio support## Revision 1.65 2000/03/08 12:17:09 rogerh# Add OpenBSD support## Revision 1.64 2000/03/08 07:09:38 rogerh# Fix typo in previous commit## Revision 1.63 2000/03/08 06:54:03 rogerh# Add support for bash shell on FreeBSD# 1) support bash OSTYPE which is of the form os+version eg freebsd3.4# 2) Fixed problem where bash has HOSTTYPE of i386, and was matching the# ifneq (,$(findstring $(HOSTTYPE),i386-linux i486-linux)) test as 'i386' is a# substring of 'i386-linux'## Revision 1.62 2000/03/03 00:37:42 robertj# Fixed problem for when have GUI environment variable set, always builds GUI!## Revision 1.61 2000/02/24 11:07:01 craigs# Fixed problem with making PW projects## Revision 1.60 2000/02/04 19:33:25 craigs# Added ability to create non-shared versions of programs## Revision 1.59 2000/02/03 23:46:26 robertj# Added power PC linux variation, thanks Brad Midgley## Revision 1.58 2000/01/25 04:55:36 robertj# Added FreeBSD support for distinction between v3.x and later versions. Thanks Roger Hardiman.## Revision 1.57 2000/01/25 04:05:23 robertj# Fixed make files for GUI systems and moved object directories to lib directory.## Revision 1.56 2000/01/22 00:51:18 craigs# Added ability to compile in any directory, and to create shared libs## Revision 1.55 2000/01/16 12:39:10 craigs# Added detection of all known ix86 MACHTYPE variants## Revision 1.54 2000/01/10 02:38:46 craigs# Fixed problem when creating dependencies with OpenSSL## Revision 1.53 2000/01/10 02:23:47 craigs# Updated for new OpenSSL## Revision 1.52 1999/11/11 08:11:01 robertj# Reworded warning in vain hope people will understand!## Revision 1.51 1999/10/22 10:21:46 craigs# Added define to only include semaphore libraries on Linux platform## Revision 1.50 1999/09/27 01:04:42 robertj# BeOS support changes.## Revision 1.49 1999/09/21 00:56:29 robertj# Added more sound support for BeOS (thanks again Yuri!)## Revision 1.48 1999/08/24 01:58:29 robertj# Added normalisation of sun4 architecture MACHTYPE to be sparc.## Revision 1.47 1999/08/09 12:46:07 robertj# Added support for libc5 and libc6 compiles under Linux (libc6 uses pthreads).## Revision 1.46 1999/07/31 03:53:16 robertj# Allowed for override of object directory suffix## Revision 1.45 1999/07/11 14:53:38 robertj# Temporarily removed pthreads for linux as is not very portable on various linuxes## Revision 1.44 1999/07/11 13:42:13 craigs# pthreads support for Linux## Revision 1.43 1999/07/03 04:31:53 robertj# Fixed problems with not including oss.cxx in library if OSTYPE not "linux"## Revision 1.42 1999/06/28 09:12:01 robertj# Fixed problems with the order in which macros are defined especially on BeOS & Solaris## Revision 1.41 1999/06/27 02:42:10 robertj# Fixed BeOS compatability.# Fixed error of platform name not supported, needed :: on main targets.## Revision 1.40 1999/06/12 06:43:36 craigs# Added PTLIB_ALT variable to allow differentiatio between libc5 and libc6 machines## Revision 1.39 1999/06/09 15:41:18 robertj# Added better UI to make files.## Revision 1.38 1999/06/07 04:49:46 robertj# Added support for SuSe linux variant.## Revision 1.38 1999/06/07 04:47:18 robertj# Added support for SUSE linux.## Revision 1.37 1999/05/01 11:29:19 robertj# Alpha linux port changes.## Revision 1.36 1999/04/29 08:46:50 robertj# Force use of GNU C compiler for .c files not only c++ files.## Revision 1.35 1999/04/29 07:04:04 robertj# Fixed missing -g in debug version## Revision 1.34 1999/03/05 07:03:27 robertj# Some more BeOS port changes.## Revision 1.33 1999/02/22 00:55:07 robertj# BeOS port changes.## Revision 1.32 1999/02/06 08:44:55 robertj# Fixed mistake in last change, library must be at end of link command.## Revision 1.31 1999/02/06 05:49:44 robertj# BeOS port effort by Yuri Kiryanov <yk@altavista.net>## Revision 1.30 1999/01/16 09:56:28 robertj# Changed some macros to more informative names.## Revision 1.29 1999/01/08 01:43:44 robertj# Changes to minimise the command line length.# FreeBSD pthreads support## Revision 1.28 1999/01/02 00:55:48 robertj# Improved OSTYPE detection.# Supported solaris x86## Revision 1.27 1998/12/02 02:37:41 robertj# New directory structure.## Revision 1.26 1998/11/24 09:39:19 robertj# FreeBSD port.## Revision 1.25 1998/11/22 08:11:41 craigs# *** empty log message ***## Revision 1.24 1998/11/16 07:30:15 robertj# Removed confusion between sunos and solaris## Revision 1.23 1998/11/14 10:47:22 robertj# Support for PPC Linux, better arrangement of variables.## Revision 1.22 1998/09/24 04:20:53 robertj# Added open software license.#ifndef PWLIBDIRPWLIBDIR = $(HOME)/pwlibendif################################################################################# Normalise environment variables so have OSTYPE and MACHTYPE correct#ifndef OSTYPEOSTYPE := $(shell uname -s)endififndef MACHTYPEMACHTYPE := $(shell uname -m)endififneq (,$(findstring linux,$(HOSTTYPE)))ifneq (,$(findstring $(HOSTTYPE),i386-linux i486-linux))OSTYPE := linuxMACHTYPE := x86endifendififeq ($(OSTYPE),mklinux)OSTYPE := linuxMACHTYPE := ppcendififneq (,$(findstring $(OSTYPE),Linux linux-gnu))OSTYPE := linuxendififneq (,$(findstring $(OSTYPE),Solaris SunOS))OSTYPE := solarisendif#Convert bash shell OSTYPE of 'freebsd3.4' to 'FreeBSD'ifneq (,$(findstring freebsd,$(OSTYPE)))OSTYPE := FreeBSDendif#Convert bash shell OSTYPE of 'openbsd2.6' to 'OpenBSD'ifneq (,$(findstring openbsd,$(OSTYPE)))OSTYPE := OpenBSDendififneq (,$(findstring macos,$(OSTYPE)))OSTYPE := macosendififneq (,$(findstring AIX,$(OSTYPE)))MACHTYPE := ppcendififneq (,$(findstring netbsd,$(OSTYPE)))OSTYPE := NetBSDendififneq (,$(findstring $(MACHTYPE),sun4))MACHTYPE := sparcendififneq (,$(findstring $(MACHTYPE),i386 i486 i586 i686 i86pc i686-pc-linux-gnu))MACHTYPE := x86endififneq (,$(findstring i386, $(MACHTYPE)))MACHTYPE := x86endififneq (,$(findstring i486, $(MACHTYPE)))MACHTYPE := x86endififneq (,$(findstring i586, $(MACHTYPE)))MACHTYPE := x86endififneq (,$(findstring i686, $(MACHTYPE)))MACHTYPE := x86endififneq (,$(findstring x86, $(MACHTYPE)))MACHTYPE := x86endififneq (,$(findstring powerpc, $(MACHTYPE)))MACHTYPE := ppcendif.PHONY: all debug opt both release clean debugclean optclean debugdepend optdepend bothdependifeq (,$(findstring $(OSTYPE),linux FreeBSD OpenBSD NetBSD solaris beos macos AIX Nucleus))all :: @echo @echo ###################################################################### @echo "Warning: OSTYPE=$(OSTYPE) support has not been confirmed. This may" @echo " be a new operating system not yet encountered, or more" @echo " likely, the OSTYPE and MACHTYPE environment variables are" @echo " set to unusual values. You may need to explicitly set these" @echo " variables for the correct operation of this system." @echo @echo " Currently supported OSTYPE names are:" @echo " linux Linux linux-gnu mklinux" @echo " solaris Solaris SunOS" @echo " FreeBSD OpenBSD NetBSD beos macos" @echo @echo " **********************************" @echo " *** DO NOT IGNORE THIS MESSAGE ***" @echo " **********************************" @echo @echo " The system almost certainly will not compile! When you get" @echo " it working please send patches to support@equival.com.au" @echo ###################################################################### @echodebug :: allopt :: allboth :: allrelease :: allclean :: alldebugclean :: alloptclean :: alldebugdepend :: alloptdepend :: allbothdepend :: allelseall :: @echo "The following targets are available:" @echo " make debug Make debug version of application" @echo " make opt Make optimised version of application" @echo " make both Make both versions of application" @echo " make release Package up optimised version int tar.gz file" @echo " make clean Remove both debug and optimised files" @echo " make debugclean Remove debug files" @echo " make optclean Remove optimised files" @echo " make debugdepend Create debug dependency files" @echo " make optdepend Create optimised dependency files" @echo " make bothdepend Create both debug and optimised dependency files"endif####################################################ifeq ($(OSTYPE),linux)# Enable pthreads if we are using glibc 6ifneq (,$(shell grep define.\*__GNU_LIBRARY__.\*6 /usr/include/features.h))P_PTHREADS = 1elseifndef PTLIB_ALTPTLIB_ALT = libc5endifendif# i486 Linux for x86, using gcc 2.7.2STDCCFLAGS += -DP_LINUXifeq ($(MACHTYPE),x86)STDCCFLAGS += -m486endififeq ($(MACHTYPE),alpha)STDCCFLAGS += -DP_64BITendififeq ($(MACHTYPE),ppc)ENDIAN := PBIG_ENDIANendififdef P_PTHREADSENDLDLIBS += -lpthreadSTDCCFLAGS += -D_REENTRANT -DP_HAS_SEMAPHORESendififndef DEBUGifndef P_SHAREDLIBP_SHAREDLIB=1endifendififeq ($(P_SHAREDLIB),0)LIB_TYPE = _selseLDLIBS += -ldlifndef PROGSTDCCFLAGS += -fPICendif # PROG
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -