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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [orpmon/] [Makefile] - Blame information for rev 829

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

Line No. Rev Author Line
1 809 simons
ifndef CROSS_COMPILE
2
CROSS_COMPILE = or32-uclinux-
3
endif
4
 
5
export  CROSS_COMPILE
6
 
7
#########################################################################
8
 
9
TOPDIR  := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
10
export  TOPDIR
11
 
12
include $(TOPDIR)/config.mk
13
 
14
# order is important here:
15
SUBDIRS = drivers common cmds services
16
 
17
LIBS  = common/common_o.o cmds/cmds.o services/services.o drivers/drivers.o
18
 
19
#########################################################################
20
 
21
all: orpmon.or32 orpmon-flash.or32
22
 
23
reset.o: reset.S Makefile
24
        $(CC) -c -o $@ $< $(CFLAGS) -DIN_FLASH=0
25
 
26
reset-flash.o: reset.S Makefile
27
        $(CC) -c -o $@ $< $(CFLAGS) -DIN_FLASH=1
28
 
29 820 markom
orpmon.or32: depend subdirs reset.o $(LIBS) Makefile gencrc
30 809 simons
        $(LD) -Tram.ld -o $@ reset.o $(LIBS)
31 822 markom
        $(OBJCOPY) -O binary $@ $@.tmp
32
#-S -j .vectors -j .text -j .data -j .rodata
33 820 markom
        ./gencrc $@.tmp $@
34 809 simons
 
35 820 markom
orpmon-flash.or32: depend subdirs reset-flash.o $(LIBS) Makefile gencrc
36 809 simons
        $(LD) -Tflash.ld -o $@ reset-flash.o $(LIBS)
37 829 markom
        $(OBJCOPY) -O binary $@ $@.tmp -S -j .reset -j .text -j .rodata
38 820 markom
        ./gencrc $@.tmp $@
39 809 simons
 
40 820 markom
gencrc: gencrc.c
41
        $(HOSTCC) -o gencrc -g gencrc.c
42
 
43 809 simons
System.map:     orpmon.or32
44
 
45
                @$(NM) $< | \
46
                grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
47
                sort > System.map
48
 
49
#########################################################################
50
 
51
depend dep:
52
        @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
53
 
54
subdirs:
55
        @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1 ; done
56
 
57
clean:
58
        find . -type f \
59
                \( -name 'core' -o -name '*.bak' -o -name '*~' \
60 820 markom
                -o -name '*.o'  -o -name '*.a' -o -name '*.tmp' \
61 809 simons
                -o -name '*.or32' -o -name '*.bin' -o -name '*.srec' \
62
                -o -name '*.mem' -o -name '*.img' \) -print \
63
                | xargs rm -f
64
        rm -f System.map
65
 
66
distclean: clean
67
        find . -type f \
68
                \( -name .depend -o -name '*.srec' -o -name '*.bin' \) \
69
                -print | xargs rm -f
70
        rm -f $(OBJS) *.bak tags TAGS
71
        rm -fr *.*~
72
 
73
#########################################################################

powered by: WebSVN 2.1.0

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