ifndef CROSS_COMPILE
|
ifndef CROSS_COMPILE
|
CROSS_COMPILE = or32-uclinux-
|
CROSS_COMPILE = or32-uclinux-
|
endif
|
endif
|
|
|
export CROSS_COMPILE
|
export CROSS_COMPILE
|
|
|
#########################################################################
|
#########################################################################
|
|
|
TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
|
TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
|
export TOPDIR
|
export TOPDIR
|
|
|
include $(TOPDIR)/config.mk
|
include $(TOPDIR)/config.mk
|
|
|
# order is important here:
|
# order is important here:
|
SUBDIRS = drivers common cmds services
|
SUBDIRS = drivers common cmds services
|
|
|
LIBS = common/common_o.o cmds/cmds.o services/services.o drivers/drivers.o
|
LIBS = common/common_o.o cmds/cmds.o services/services.o drivers/drivers.o
|
|
|
#########################################################################
|
#########################################################################
|
|
|
all: orpmon.or32 orpmon-flash.or32
|
all: orpmon.or32 orpmon-flash.or32
|
|
|
reset.o: reset.S Makefile
|
reset.o: reset.S Makefile
|
$(CC) -c -o $@ $< $(CFLAGS) -DIN_FLASH=0
|
$(CC) -c -o $@ $< $(CFLAGS) -DIN_FLASH=0
|
|
|
reset-flash.o: reset.S Makefile
|
reset-flash.o: reset.S Makefile
|
$(CC) -c -o $@ $< $(CFLAGS) -DIN_FLASH=1
|
$(CC) -c -o $@ $< $(CFLAGS) -DIN_FLASH=1
|
|
|
orpmon.or32: depend subdirs reset.o $(LIBS) Makefile
|
orpmon.or32: depend subdirs reset.o $(LIBS) Makefile
|
$(LD) -Tram.ld -o $@ reset.o $(LIBS)
|
$(LD) -Tram.ld -o $@ reset.o $(LIBS)
|
|
|
orpmon-flash.or32: depend subdirs reset-flash.o $(LIBS) Makefile
|
orpmon-flash.or32: depend subdirs reset-flash.o $(LIBS) Makefile
|
$(LD) -Tflash.ld -o $@ reset-flash.o $(LIBS)
|
$(LD) -Tflash.ld -o $@ reset-flash.o $(LIBS)
|
|
|
System.map: orpmon.or32
|
System.map: orpmon.or32
|
|
|
@$(NM) $< | \
|
@$(NM) $< | \
|
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
sort > System.map
|
sort > System.map
|
|
|
#########################################################################
|
#########################################################################
|
|
|
depend dep:
|
depend dep:
|
@for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
|
@for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
|
|
|
subdirs:
|
subdirs:
|
@for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1 ; done
|
@for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1 ; done
|
|
|
clean:
|
clean:
|
find . -type f \
|
find . -type f \
|
\( -name 'core' -o -name '*.bak' -o -name '*~' \
|
\( -name 'core' -o -name '*.bak' -o -name '*~' \
|
-o -name '*.o' -o -name '*.a' \
|
-o -name '*.o' -o -name '*.a' \
|
-o -name '*.or32' -o -name '*.bin' -o -name '*.srec' \
|
-o -name '*.or32' -o -name '*.bin' -o -name '*.srec' \
|
-o -name '*.mem' -o -name '*.img' \) -print \
|
-o -name '*.mem' -o -name '*.img' \) -print \
|
| xargs rm -f
|
| xargs rm -f
|
rm -f System.map
|
rm -f System.map
|
|
|
distclean: clean
|
distclean: clean
|
find . -type f \
|
find . -type f \
|
\( -name .depend -o -name '*.srec' -o -name '*.bin' \) \
|
\( -name .depend -o -name '*.srec' -o -name '*.bin' \) \
|
-print | xargs rm -f
|
-print | xargs rm -f
|
rm -f $(OBJS) *.bak tags TAGS
|
rm -f $(OBJS) *.bak tags TAGS
|
rm -fr *.*~
|
rm -fr *.*~
|
|
|
#########################################################################
|
#########################################################################
|
|
|