OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [userland/] [sh/] [Makefile] - Blame information for rev 199

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
# Makefile for sh
2
 
3
PROG      := sh
4
BUILDTIME := $(shell TZ=UTC date --utc "+%Y.%m.%d-%H:%M%z")
5
 
6
 
7
# With a modern GNU make(1) (highly recommended, that's what all the
8
# developers use), all of the following configuration values can be
9
# overridden at the command line.  For example:
10
#   make CROSS=powerpc-linux- DOSTATIC=true
11
 
12
# If you want a static binary, turn this on.
13
DOSTATIC = true
14
 
15
# Set the following to `true' to make a debuggable build.
16
# Leave this set to `false' for production use.
17
# eg: `make DODEBUG=true tests'
18
# Do not enable this for production builds...
19
DODEBUG = false
20
 
21
# If you are running a cross compiler, you may want to set this
22
# to something more interesting, like "powerpc-linux-".
23
CROSS =or32-elf-
24
CC = $(CROSS)gcc
25
LD = $(CROSS)ld
26
STRIPTOOL = $(CROSS)strip
27
 
28
# To compile vs an alternative libc, you may need to use/adjust
29
# the following lines to meet your needs.
30
#LIBCDIR=/home/andersen/CVS/uC-libc
31
#GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
32
#CFLAGS+=-nostdinc -I$(LIBCDIR)/include -I$(GCCINCDIR)
33
#LDFLAGS+=-nostdlib
34
#LIBRARIES = $(LIBCDIR)/libc.a -lgcc
35
 
36
#--------------------------------------------------------
37
 
38
# use '-Os' optimization if available, else use -O2
39
OPTIMIZATION = $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
40
    then echo "-Os"; else echo "-O2" ; fi)
41
 
42
WARNINGS =
43
 
44
ifeq ($(DODEBUG),true)
45
    CFLAGS  += $(WARNINGS) -g -D_GNU_SOURCE -I../../uC-libc/include
46
    LDFLAGS +=
47
    STRIP    =
48
else
49
    CFLAGS  += $(WARNINGS) $(OPTIMIZATION) -fomit-frame-pointer -D_GNU_SOURCE
50
    CFLAGS  += -I../../uC-libc/include
51
 
52
    LDFLAGS += -s -L/home/simons/uClinux/uC-libc/
53
    LDFLAGS += -L/home/simons/uClinux/uC-libc/
54
    LDFLAGS += -L/home/simons/or1k/lib/gcc-lib/or32-elf/2.95.2/
55
 
56
    STRIP    = $(STRIPTOOL) --remove-section=.note --remove-section=.comment $(PROG)
57
endif
58
ifeq ($(DOSTATIC),true)
59
    LDFLAGS += --static
60
    #
61
    #use '-ffunction-sections -fdata-sections' and '--gc-sections' (if they
62
    # work) to try and strip out any unused junk.  Doesn't do much for me,
63
    # but you may want to give it a shot...
64
    #
65
    #ifeq ($(shell $(CC) -ffunction-sections -fdata-sections -S \
66
    #   -o /dev/null -xc /dev/null 2>/dev/null && $(LD) \
67
    #                   --gc-sections -v >/dev/null && echo 1),1)
68
    #   CFLAGS += -ffunction-sections -fdata-sections
69
    #   LDFLAGS += --gc-sections
70
    #endif
71
endif
72
 
73
 
74
OBJ     = sh1.o sh2.o sh3.o sh4.o sh5.o
75
 
76
all:    $(PROG)
77
 
78
$(PROG):        $(OBJ)
79
        $(LD) $(LDFLAGS) -r -o $@ $(OBJ) /home/simons/or1k/or32-elf/lib/crt0.o -lc -lgcc
80
 
81
.S.o:
82
        $(CC) $(CFLAGS) -c -o $*.o $<
83
 
84
clean:
85
        rm -f sh *.coff *.o *.bak core
86
 
87
.PHONY: tags
88
tags:
89
        ctags -R .
90
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.