]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - board/MAI/bios_emulator/scitech/makedefs/gcc_freebsd.mk
* Patch by Thomas Frieden, 13 Nov 2002:
[karo-tx-uboot.git] / board / MAI / bios_emulator / scitech / makedefs / gcc_freebsd.mk
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
33 # Disable warnings for macros redefined here that were given
34 # on the command line.
35 __.SILENT       := $(.SILENT)
36 .SILENT         := yes
37
38 # Import enivornment variables that we use common to all compilers
39 .IMPORT .IGNORE : TEMP SHELL INCLUDE LIB SCITECH PRIVATE SCITECH_LIB
40 .IMPORT .IGNORE : DBG OPT OPT_SIZE SHW BETA CHECKED USE_X11 USE_FREEBSD
41 .IMPORT .IGNORE : USE_EGCS USE_PGCC STATIC_LIBS
42    TMPDIR       := $(TEMP)
43
44 # Standard file suffix definitions
45 #
46 # NOTE: Linux does not require any extenion for executeable files, but you
47 #       can use an extension if you wish. We use the .x extension for building
48 #       executeable files so that we can use implicit rules to make the
49 #       makefiles simpler and more portable between systems. When you install
50 #       the files to a local bin directory, you will probably want to remove
51 #       the .x extension.
52    L            := .a           # Libraries
53    E            := .x           # Executables
54    O            := .o           # Objects
55    A            := .asm         # Assembler sources
56    S            := .s       # GNU assembler sources
57    P            := .cpp         # C++ sources
58
59 # File prefix/suffix definitions. The following prefixes are defined, and are
60 # used primarily to abstract between the Unix style libXX.a naming convention
61 # and the DOS/Windows/OS2 naming convention of XX.lib.
62    LP           := lib      # LP - Library file prefix (name of file on disk)
63    LL           := -l           # Library link prefix (name of library on link command line)
64    LE           :=                  # Library link suffix (extension of library on link command line)
65
66 # We use the Unix shell at all times
67    SHELL                := /bin/sh
68    SHELLFLAGS   := -c
69
70 # Definition of $(MAKE) macro for recursive makes.
71    MAKE = $(MAKECMD) $(MFLAGS)
72
73 # Macro to install a library file
74    INSTALL      := cp
75
76 # DMAKE uses this recipe to remove intermediate targets
77 .REMOVE :; $(RM) -f $<
78
79 # Turn warnings back to previous setting.
80 .SILENT := $(__.SILENT)
81
82 # We dont use TABS in our makefiles
83 .NOTABS         := yes
84
85 # Define that we are compiling for FreeBSD
86    USE_LINUX    := 1
87
88 # Default commands for compiling, assembling linking and archiving.
89 .IF $(USE_EGCS)
90    CC           := egcs
91 .ELIF $(USE_PGCC)
92    CC           := pgcc
93 .ELSE
94    CC           := gcc
95 .ENDIF
96    CFLAGS       := -Wall -I. -Iinclude $(INCLUDE)
97    CXX          := g++
98    AS           := nasm
99 # TODO: On earlier versions of FreeBSD (<3.0) a.out is used instead of ELF
100    ASFLAGS      := -f elf -d__FLAT__ -iinclude -i$(SCITECH)/include -d__NOU__
101    LD           := g++
102    LDFLAGS      := -L.
103    LIB          := ar
104    LIBFLAGS     := rcs
105
106 # Link to static libraries if requested
107 .IF $(STATIC_LIBS)
108    LDFLAGS      += -static
109 .ENDIF
110
111 # Optionally turn on debugging information
112 .IF $(DBG)
113    CFLAGS       += -g
114 .ELSE
115 # NASM does not support debugging information yet
116    ASFLAGS      +=
117 .ENDIF
118
119 # Optionally turn on optimisations
120 .IF $(OPT_MAX)
121    CFLAGS       += -O6
122 .ELIF $(OPT)
123    CFLAGS       += -O2
124 .ELIF $(OPT_SIZE)
125    CFLAGS       += -O1
126 .ENDIF
127
128 # Optionally turn on direct i387 FPU instructions
129 .IF $(FPU)
130    CFLAGS       += -DFPU387
131    ASFLAGS      += -dFPU387
132 .END
133
134 # Optionally compile a beta release version of a product
135 .IF $(BETA)
136    CFLAGS       += -DBETA
137    ASFLAGS      += -dBETA
138 .ENDIF
139
140 # Disable standard C runtime library
141
142 .IF $(NO_RUNTIME)
143 CFLAGS                  += -fno-builtin -nostdinc
144 .ENDIF
145
146 # Compile flag for whether to build X11 or non-X11 lib
147 .IF $(USE_X11)
148    CFLAGS       += -D__X11__
149 .ENDIF
150
151 # Target environment dependant flags
152    CFLAGS       += -D__FREEBSD__
153    ASFLAGS      += -d__FREEBSD__ -d__UNIX__
154
155 # Define the base directory for library files
156
157 .IF $(CHECKED)
158 LIB_BASE_DIR    := $(SCITECH_LIB)/lib/debug
159 CFLAGS          += -DCHECKED=1
160 .ELSE
161 LIB_BASE_DIR    := $(SCITECH_LIB)/lib/release
162 .ENDIF
163
164 # Define where to install library files
165    LIB_DEST     := $(LIB_BASE_DIR)/freebsd/gcc
166    LDFLAGS      += -L$(LIB_DEST)
167
168 # Place to look for PMODE library files
169
170 PMLIB           := -lpm
171
172 # Define which file contains our rules
173
174    RULES_MAK    := gcc_freebsd.mk