summaryrefslogtreecommitdiffstats
path: root/make/custom/go32.cfg
blob: a9c4de6617a2c691c3825cab857f84cb7c5b78b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#
#  Config file for the go32 BSP .. CPU model defaults to an i486DX
#  unless set otherwise by a custom configuration file which overrides.
#
#  $Id$
#

# default to i486dx as cpu
ifeq ($(RTEMS_GO32_CPU_MODEL),)
TARGET_ARCH=o-go32
RTEMS_CPU_MODEL=i486dx
else
ifeq ($(RTEMS_GO32_CPU_MODEL),pentium)
TARGET_ARCH=o-go32_p5
RTEMS_CPU_MODEL=pentium
endif # pentium
endif # i486dx

include $(RTEMS_ROOT)/make/custom/default.cfg

# Sharing a single bsp among multiple cpu models results in us having to
# explicitly set some values normally taken care of in the defaults.cfg
# file.

RTEMS_CPU=i386

# This is the actual bsp directory used during the build process.
RTEMS_BSP_FAMILY=go32

## Target compiler config file, if any
CONFIG.$(TARGET_ARCH).CC = $(RTEMS_ROOT)/make/compilers/gcc-target-default.cfg

# We may install in a CPU model based directory but this is still
# a go32 based bsp.
RTEMS_BSP=go32

#  This contains the compiler options necessary to select the CPU model
#  and (hopefully) optimize for it. 
#
#  NOTE:  As gcc grows to include more options, this section should also grow.
#
ifeq ($(RTEMS_CPU_MODEL),i486dx)
CPU_CFLAGS = -m486
else
ifeq ($(RTEMS_CPU_MODEL),pentium)
CPU_CFLAGS = -m486
else
CPU_CFLAGS =
endif   # pentium
endif   # i486dx

# optimize flag: typically -0, could use -O4 or -fast
# -O4 is ok for RTEMS
CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer

# This target does NOT support the TCP/IP stack so ignore requests
# to enable it.
HAS_NETWORKING=no

# Base name of start file
# go32 does not use the rtems start file
START_BASE=

#  This section makes the target dependent options file.

#  NDEBUG (C library)
#     if defined asserts do not generate code.  This is commonly used
#     as a command line option.
#
#  RTEMS_TEST_NO_PAUSE (RTEMS tests)
#     do not pause between screens of output in the rtems tests
#
#  RTEMS_DEBUG (RTEMS)
#     If defined, debug checks in RTEMS and support library code are enabled.

define make-target-options
	@echo "/* #define NDEBUG 1 */ "                     >>$@
	@echo "#define RTEMS_TEST_NO_PAUSE 1"               >>$@
	@echo "/* #define RTEMS_DEBUG  1 */"                >>$@
endef

# Ultimately, it would be nice to do this when in a cross environment:
#	$(COFF2EXE) $(basename $@).out

# The following are definitions of make-exe which will work using ld as
# is currently required.  It is expected that as of gcc 2.8, the end user
# will be able to override parts of the compilers specs and link using gcc.

# may need to reference libpc.a

ifeq ($(RTEMS_USE_GCC272),yes)
define make-exe
	$(LD) $(LDFLAGS) -N -o $(basename $@).exe \
	    $(shell $(CC) $(CPU_CFLAGS) -print-file-name=crt0.o) \
	    $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group \
	    $(shell $(CC) $(CPU_CFLAGS) -print-file-name=libcgo32.a $(GCCSED)) \
	    $(shell $(CC) $(CPU_CFLAGS) -print-file-name=libpc.a $(GCCSED))
	$(NM) -g -n $(basename $@).exe > $(basename $@).num
	$(SIZE) $(basename $@).exe
endef

else
define make-exe
	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).exe \
	    $(LINK_OBJS) $(LINK_LIBS)
	$(NM) -g -n $(basename $@).exe > $(basename $@).num
	$(SIZE) $(basename $@).exe
endef

endif


# Miscellaneous additions go here