gcc_freebsd.mk 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. #############################################################################
  2. #
  3. # SciTech Multi-platform Graphics Library
  4. #
  5. # ========================================================================
  6. #
  7. # The contents of this file are subject to the SciTech MGL Public
  8. # License Version 1.0 (the "License"); you may not use this file
  9. # except in compliance with the License. You may obtain a copy of
  10. # the License at http://www.scitechsoft.com/mgl-license.txt
  11. #
  12. # Software distributed under the License is distributed on an
  13. # "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  14. # implied. See the License for the specific language governing
  15. # rights and limitations under the License.
  16. #
  17. # The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
  18. #
  19. # The Initial Developer of the Original Code is SciTech Software, Inc.
  20. # All Rights Reserved.
  21. #
  22. # ========================================================================
  23. #
  24. # Descripton: Generic DMAKE startup makefile definitions file. Assumes
  25. # that the SCITECH environment variable has been set to point
  26. # to where all our stuff is installed. You should not need
  27. # to change anything in this file.
  28. #
  29. # Linux version for GNU C/C++.
  30. #
  31. #############################################################################
  32. # Disable warnings for macros redefined here that were given
  33. # on the command line.
  34. __.SILENT := $(.SILENT)
  35. .SILENT := yes
  36. # Import enivornment variables that we use common to all compilers
  37. .IMPORT .IGNORE : TEMP SHELL INCLUDE LIB SCITECH PRIVATE SCITECH_LIB
  38. .IMPORT .IGNORE : DBG OPT OPT_SIZE SHW BETA CHECKED USE_X11 USE_FREEBSD
  39. .IMPORT .IGNORE : USE_EGCS USE_PGCC STATIC_LIBS
  40. TMPDIR := $(TEMP)
  41. # Standard file suffix definitions
  42. #
  43. # NOTE: Linux does not require any extenion for executeable files, but you
  44. # can use an extension if you wish. We use the .x extension for building
  45. # executeable files so that we can use implicit rules to make the
  46. # makefiles simpler and more portable between systems. When you install
  47. # the files to a local bin directory, you will probably want to remove
  48. # the .x extension.
  49. L := .a # Libraries
  50. E := .x # Executables
  51. O := .o # Objects
  52. A := .asm # Assembler sources
  53. S := .s # GNU assembler sources
  54. P := .cpp # C++ sources
  55. # File prefix/suffix definitions. The following prefixes are defined, and are
  56. # used primarily to abstract between the Unix style libXX.a naming convention
  57. # and the DOS/Windows/OS2 naming convention of XX.lib.
  58. LP := lib # LP - Library file prefix (name of file on disk)
  59. LL := -l # Library link prefix (name of library on link command line)
  60. LE := # Library link suffix (extension of library on link command line)
  61. # We use the Unix shell at all times
  62. SHELL := /bin/sh
  63. SHELLFLAGS := -c
  64. # Definition of $(MAKE) macro for recursive makes.
  65. MAKE = $(MAKECMD) $(MFLAGS)
  66. # Macro to install a library file
  67. INSTALL := cp
  68. # DMAKE uses this recipe to remove intermediate targets
  69. .REMOVE :; $(RM) -f $<
  70. # Turn warnings back to previous setting.
  71. .SILENT := $(__.SILENT)
  72. # We dont use TABS in our makefiles
  73. .NOTABS := yes
  74. # Define that we are compiling for FreeBSD
  75. USE_LINUX := 1
  76. # Default commands for compiling, assembling linking and archiving.
  77. .IF $(USE_EGCS)
  78. CC := egcs
  79. .ELIF $(USE_PGCC)
  80. CC := pgcc
  81. .ELSE
  82. CC := gcc
  83. .ENDIF
  84. CFLAGS := -Wall -I. -Iinclude $(INCLUDE)
  85. CXX := g++
  86. AS := nasm
  87. # TODO: On earlier versions of FreeBSD (<3.0) a.out is used instead of ELF
  88. ASFLAGS := -f elf -d__FLAT__ -iinclude -i$(SCITECH)/include -d__NOU__
  89. LD := g++
  90. LDFLAGS := -L.
  91. LIB := ar
  92. LIBFLAGS := rcs
  93. # Link to static libraries if requested
  94. .IF $(STATIC_LIBS)
  95. LDFLAGS += -static
  96. .ENDIF
  97. # Optionally turn on debugging information
  98. .IF $(DBG)
  99. CFLAGS += -g
  100. .ELSE
  101. # NASM does not support debugging information yet
  102. ASFLAGS +=
  103. .ENDIF
  104. # Optionally turn on optimisations
  105. .IF $(OPT_MAX)
  106. CFLAGS += -O6
  107. .ELIF $(OPT)
  108. CFLAGS += -O2
  109. .ELIF $(OPT_SIZE)
  110. CFLAGS += -O1
  111. .ENDIF
  112. # Optionally turn on direct i387 FPU instructions
  113. .IF $(FPU)
  114. CFLAGS += -DFPU387
  115. ASFLAGS += -dFPU387
  116. .END
  117. # Optionally compile a beta release version of a product
  118. .IF $(BETA)
  119. CFLAGS += -DBETA
  120. ASFLAGS += -dBETA
  121. .ENDIF
  122. # Disable standard C runtime library
  123. .IF $(NO_RUNTIME)
  124. CFLAGS += -fno-builtin -nostdinc
  125. .ENDIF
  126. # Compile flag for whether to build X11 or non-X11 lib
  127. .IF $(USE_X11)
  128. CFLAGS += -D__X11__
  129. .ENDIF
  130. # Target environment dependant flags
  131. CFLAGS += -D__FREEBSD__
  132. ASFLAGS += -d__FREEBSD__ -d__UNIX__
  133. # Define the base directory for library files
  134. .IF $(CHECKED)
  135. LIB_BASE_DIR := $(SCITECH_LIB)/lib/debug
  136. CFLAGS += -DCHECKED=1
  137. .ELSE
  138. LIB_BASE_DIR := $(SCITECH_LIB)/lib/release
  139. .ENDIF
  140. # Define where to install library files
  141. LIB_DEST := $(LIB_BASE_DIR)/freebsd/gcc
  142. LDFLAGS += -L$(LIB_DEST)
  143. # Place to look for PMODE library files
  144. PMLIB := -lpm
  145. # Define which file contains our rules
  146. RULES_MAK := gcc_freebsd.mk