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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [orpmon/] [Makefile] - Blame information for rev 824

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 824 markom
# $(LIBS)
38 822 markom
        $(OBJCOPY) -O binary $@ $@.tmp
39
# -S -j .reset -j .text -j .rodata
40 820 markom
        ./gencrc $@.tmp $@
41 809 simons
 
42 820 markom
gencrc: gencrc.c
43
        $(HOSTCC) -o gencrc -g gencrc.c
44
 
45 809 simons
System.map:     orpmon.or32
46
 
47
                @$(NM) $< | \
48
                grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
49
                sort > System.map
50
 
51
#########################################################################
52
 
53
depend dep:
54
        @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
55
 
56
subdirs:
57
        @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1 ; done
58
 
59
clean:
60
        find . -type f \
61
                \( -name 'core' -o -name '*.bak' -o -name '*~' \
62 820 markom
                -o -name '*.o'  -o -name '*.a' -o -name '*.tmp' \
63 809 simons
                -o -name '*.or32' -o -name '*.bin' -o -name '*.srec' \
64
                -o -name '*.mem' -o -name '*.img' \) -print \
65
                | xargs rm -f
66
        rm -f System.map
67
 
68
distclean: clean
69
        find . -type f \
70
                \( -name .depend -o -name '*.srec' -o -name '*.bin' \) \
71
                -print | xargs rm -f
72
        rm -f $(OBJS) *.bak tags TAGS
73
        rm -fr *.*~
74
 
75
#########################################################################

powered by: WebSVN 2.1.0

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