File: Makefile-Be.inc

package info (click to toggle)
prcs 1.3.1-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,304 kB
  • ctags: 3,395
  • sloc: cpp: 17,388; ansic: 8,305; sh: 2,621; lisp: 1,816; perl: 649; lex: 354; makefile: 208; pascal: 85
file content (101 lines) | stat: -rw-r--r-- 2,894 bytes parent folder | download | duplicates (5)
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
#---------------------------------------------------------------------
# This Makefile-Include for BeOS is part of PRCS.
# Copyright (C) 1998 Lars Duening
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this library; see the file COPYING.  If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
# MA  02111-1307, USA.
#----------------------------------------------------------------------
#
# Usage: make [CPU=ppc|x86] [<target>]
#
# The variable CPU determines the platform for which the program is
# compiled. If left unspecified, the executing platform is targeted.
# The created objects and binaries are located in subdirectories with
# the name 'obj.<CPU>'.
#
# Target is one of the typical GNU makefile targets.
#----------------------------------------------------------------------

# Determine the CPU if not specified on the command line.
#   set MACHINE to the host machine
#   set NATIVE  to the host cpu
#   set CROSS   to the non-host cpu

MACHINE =$(shell uname -m)

ifndef CPU
ifeq ($(MACHINE), BePC)
    CPU = x86
else
    CPU = ppc
endif
endif
ifeq ($MACHINE), BePC)
    NATIVE = x86
    CROSS = ppc
else
    NATIVE = ppc
    CROSS = x86
endif

# Set the object directory
    OBJ := obj.$(CPU)

# Specify the directory for libraries
    BELIBS = /boot/develop/lib/$(CPU)

# Specify the default libraries
    DEFAULT_LIBS = libbe.so libroot.so libnet.so

# The path to the headers
    BEHEADERS = /boot/develop/headers
    
# Specify the common tools and their initial flags
    MIMESET = mimeset

    CC = mwcc$(CPU)
    CXX = mwcc$(CPU)

    LD = mwld$(CPU)
    LDFLAGS += -sym full -xma -nodefaults \
              $(BELIBS)/glue-noinit.a \
              $(BELIBS)/init_term_dyn.o \
              $(BELIBS)/start_dyn.o
    
# Platform specific settings
ifeq ($(CPU), x86)
    LIB = .LIB
    CFLAGS += -inline off -O4
    CXXFLAGS += -inline off -O4
endif

ifeq ($(CPU), ppc)
    LIB = 
    CFLAGS += -opt full
    CXXFLAGS += -opt full
    LDFLAGS += -nodup -export pragma -init _init_routine_ -term _term_routine_
endif

# set the full directory variable if not specified
ifeq ($(FULL_DIR),)
    FULL_DIR := $(shell pwd)
endif

# Create the list of libraries to use
    LIBS_TO_USE = $(addprefix $(BELIBS)/, $(addsuffix $(LIB), $(DEFAULT_LIBS) ))

# Complete the linker flags
    LDFLAGS += -L$(FULL_DIR) -L$(BELIBS) $(LIBS_TO_USE)