]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - board/MAI/bios_emulator/scitech/makedefs/gcc_linux.mk
* Patch by Thomas Frieden, 13 Nov 2002:
[karo-tx-uboot.git] / board / MAI / bios_emulator / scitech / makedefs / gcc_linux.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 # Include standard startup script definitions
34 .IMPORT: SCITECH
35 .INCLUDE: "$(SCITECH)/makedefs/startup.mk"
36
37 # Import enivornment variables that we use
38 .IMPORT .IGNORE : GCC2_LIBBASE
39
40 # Override some file suffix definitions
41    L            := .a     # Libraries
42    O            := .o     # Objects
43
44 # Override the file prefix/suffix definitions for library naming.
45    LP           := lib          # LP - Library file prefix (name of file on disk)
46    LL           := -l           # Library link prefix (name of library on link command line)
47    LE           :=                      # Library link suffix (extension of library on link command line)
48
49 # We are compiling for a 32 bit envionment
50    _32BIT_      := 1
51
52 # Define that we are compiling for Linux
53    USE_LINUX    := 1
54
55 # Default commands for compiling, assembling linking and archiving.
56    CC           := gcc
57    CFLAGS       := -Wall -I. -Iinclude -I$(SCITECH:s,\,/)/include -I$(PRIVATE:s,\,/)/include
58    SHOW_CFLAGS  := -c
59    CXX          := g++
60    AS           := nasm
61    ASFLAGS      := -t -f elf -d__FLAT__ -d__GNUC__ -iinclude -i$(SCITECH)/include -d__NOU__
62    SHOW_ASFLAGS := -f elf
63    LD           := gcc
64    LDXX                 := g++
65    LDFLAGS      := -L.
66    LIB          := ar
67    LIBFLAGS     := rcs
68    YACC                 := bison -y
69    LEX                  := flex
70    SED                  := sed
71
72 # Optionally turn on debugging information
73 .IF $(DBG)
74    CFLAGS       += -g
75    SHOW_CFLAGS  += -g
76 .ELSE
77 # NASM does not support debugging information yet
78    ASFLAGS      +=
79 .ENDIF
80
81 # Optionally turn on optimisations
82 .IF $(OPT_MAX)
83    CFLAGS       += -O6
84    SHOW_CFLAGS  += -O6
85 .ELIF $(OPT)
86    CFLAGS       += -O2
87    SHOW_CFLAGS  += -O2
88 .ELIF $(OPT_SIZE)
89    CFLAGS       += -O1
90    SHOW_CFLAGS  += -O1
91 .ENDIF
92
93 # Optionally turn on direct i387 FPU instructions
94 .IF $(FPU)
95    CFLAGS       += -DFPU387
96    ASFLAGS      += -dFPU387
97 .END
98
99 # Optionally compile a beta release version of a product
100 .IF $(BETA)
101    CFLAGS       += -DBETA
102    SHOW_CFLAGS  += -DBETA
103    ASFLAGS      += -dBETA
104    SHOW_ASFLAGS += -dBETA
105 .ENDIF
106
107 # Disable standard C runtime library
108
109 .IF $(NO_RUNTIME)
110 CFLAGS                  += -fno-builtin -nostdinc
111 .ENDIF
112
113 # Compile flag for whether to build X11 or non-X11 lib
114 .IF $(USE_X11)
115    CFLAGS       += -D__X11__
116 .ENDIF
117
118 # Target environment dependant flags
119    CFLAGS       += -D__LINUX__
120    ASFLAGS      += -d__LINUX__ -d__UNIX__
121
122 # Define the base directory for library files
123
124 .IF $(CHECKED)
125 LIB_BASE_DIR    := $(SCITECH_LIB)/lib/debug
126 CFLAGS              += -DCHECKED=1
127 SHOW_CFLAGS         += -DCHECKED=1
128 .ELSE
129 LIB_BASE_DIR    := $(SCITECH_LIB)/lib/release
130 .ENDIF
131
132 # Define where to install library files
133 .IF $(LIBC)
134    LIB_DEST_SHARED  := $(LIB_BASE_DIR)/linux/gcc/libc.so
135    LIB_DEST_STATIC  := $(LIB_BASE_DIR)/linux/gcc/libc
136 .ELSE
137    LIB_DEST_SHARED  := $(LIB_BASE_DIR)/linux/gcc/glibc.so
138    LIB_DEST_STATIC  := $(LIB_BASE_DIR)/linux/gcc/glibc
139 .ENDIF
140
141 # Link to static libraries if requested
142 .IF $(STATIC_LIBS_ALL)
143    LDFLAGS      += -static
144    STATIC_LIBS  := 1
145 .ENDIF
146
147 # Link to static libraries if requested
148 .IF $(STATIC_LIBS)
149    LDFLAGS      += -L$(LIB_DEST_STATIC)
150 .ELSE
151    LDFLAGS      += -L$(LIB_DEST_SHARED) -L$(LIB_DEST_STATIC)
152 .ENDIF
153
154 # Optionally enable some  dynamic libraries to be built
155 .IF $(BUILD_DLL)
156 .IF $(VERSIONMAJ)
157 .ELSE
158    VERSIONMAJ   := 5
159    VERSIONMIN   := 0
160 .ENDIF
161    VERSION      := $(VERSIONMAJ).$(VERSIONMIN)
162    LIB              := gcc -shared
163    LIBFLAGS         :=
164    L                := .so
165    CFLAGS           += -fPIC
166    SHOW_CFLAGS  += -fPIC
167    ASFLAGS      += -D__PIC__
168    SHOW_ASFLAGS += -D__PIC__
169    LIB_DEST     := $(LIB_DEST_SHARED)
170 .ELSE
171    LIB_DEST     := $(LIB_DEST_STATIC)
172 .ENDIF
173
174 # Place to look for PMODE library files
175
176 PMLIB           := -lpm
177
178 # Define which file contains our rules
179
180    RULES_MAK    := gcc_linux.mk
181