user_makefile
时间:2006-06-06 来源:rwen2012
#
# Makefile -- Build instructions for user level apps
#
.EXPORT_ALL_VARIABLES:
#
# Include architecture specific build rules.
#
ifndef ROOTDIR
ROOTDIR=..
endif
UCLINUX_BUILD_USER=1
-include $(LINUX_CONFIG)
-include $(CONFIG_CONFIG)
-include $(ARCH_CONFIG)
-include $(MODULES_CONFIG)
VEND=$(ROOTDIR)/vendors
#
# must run the vendor build first
#
dir_v = $(VEND)/$(CONFIG_VENDOR)/$(CONFIG_PRODUCT)/.
dir_y =
dir_n =
dir_ =
#dir_y += idetest memtools
dir_$(CONFIG_JFFS_FS) += mtd-utils
dir_$(CONFIG_JFFS2_FS) += mtd-utils
dir_y += ena ak4566
#add by HHTECH zy
#dir_y +=softdog
dir_y += ttytest
dir_y += mp3play
dir_$(CONFIG_USER_AGETTY_AGETTY) += agetty
dir_$(CONFIG_USER_TINYLOGIN_TINYLOGIN) += tinylogin
dir_$(CONFIG_USER_TIP_TIP) += tip
dir_$(CONFIG_USER_TIMEPEG_TPT) += tpt
#
# ......
#
dir_$(CONFIG_USER_W3CAM_W3CAMD) += w3cam
dir_$(CONFIG_USER_WGET) += wget
dir_$(CONFIG_USER_WIRELESS_TOOLS) += wireless_tools
dir_$(CONFIG_USER_ZEBRA_BGPD_BGPD) += zebra
dir_$(CONFIG_USER_ZEBRA_OSPFD_OSPFD) += zebra
dir_$(CONFIG_USER_ZEBRA_RIPD_RIPD) += zebra
dir_$(CONFIG_USER_ZEBRA_ZEBRA_ZEBRA) += zebra
dir_y += games
all:
for i in $(dir_v) $(sort $(dir_y)) ; do make -C $$i || exit $? ; done
romfs:
for i in $(dir_v) $(sort $(dir_y)) ; do make -C $$i romfs || exit $? ; done
clean:
-for i in $(dir_v) $(sort $(dir_y) $(dir_n) $(dir_)) ; do \
[ ! -d $$i ] || make -C $$i clean; \
done
prune:
-for i in $(sort $(dir_n) $(dir_)) ; do \
found=0; \
for j in $(sort $(dir_y)) ; do \
if [ $$i == $$j ]; then \
found=1; \
fi; \
done; \
if [ $$found == 0 ]; then \
rm -r $$i; \
fi; \
done
#######################################################
#
# the sub-dir in the user dir
#
#######################################################
EXEC = tftp
OBJS = tftp.o main.o tftpsubs.o
all: $(EXEC)
$(EXEC): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
$(OBJS): tftpsubs.h
romfs:
$(ROMFSINST) /bin/$(EXEC)
clean:
-rm -f $(EXEC) *.elf *.gdb *.o
#############################################
# Makefile -- Build instructions for user level apps
#
.EXPORT_ALL_VARIABLES:
#
# Include architecture specific build rules.
#
ifndef ROOTDIR
ROOTDIR=..
endif
UCLINUX_BUILD_USER=1
-include $(LINUX_CONFIG)
-include $(CONFIG_CONFIG)
-include $(ARCH_CONFIG)
-include $(MODULES_CONFIG)
VEND=$(ROOTDIR)/vendors
#
# must run the vendor build first
#
dir_v = $(VEND)/$(CONFIG_VENDOR)/$(CONFIG_PRODUCT)/.
dir_y =
dir_n =
dir_ =
#dir_y += idetest memtools
dir_$(CONFIG_JFFS_FS) += mtd-utils
dir_$(CONFIG_JFFS2_FS) += mtd-utils
dir_y += ena ak4566
#add by HHTECH zy
#dir_y +=softdog
dir_y += ttytest
dir_y += mp3play
dir_$(CONFIG_USER_AGETTY_AGETTY) += agetty
dir_$(CONFIG_USER_TINYLOGIN_TINYLOGIN) += tinylogin
dir_$(CONFIG_USER_TIP_TIP) += tip
dir_$(CONFIG_USER_TIMEPEG_TPT) += tpt
#
# ......
#
dir_$(CONFIG_USER_W3CAM_W3CAMD) += w3cam
dir_$(CONFIG_USER_WGET) += wget
dir_$(CONFIG_USER_WIRELESS_TOOLS) += wireless_tools
dir_$(CONFIG_USER_ZEBRA_BGPD_BGPD) += zebra
dir_$(CONFIG_USER_ZEBRA_OSPFD_OSPFD) += zebra
dir_$(CONFIG_USER_ZEBRA_RIPD_RIPD) += zebra
dir_$(CONFIG_USER_ZEBRA_ZEBRA_ZEBRA) += zebra
dir_y += games
all:
for i in $(dir_v) $(sort $(dir_y)) ; do make -C $$i || exit $? ; done
romfs:
for i in $(dir_v) $(sort $(dir_y)) ; do make -C $$i romfs || exit $? ; done
clean:
-for i in $(dir_v) $(sort $(dir_y) $(dir_n) $(dir_)) ; do \
[ ! -d $$i ] || make -C $$i clean; \
done
prune:
-for i in $(sort $(dir_n) $(dir_)) ; do \
found=0; \
for j in $(sort $(dir_y)) ; do \
if [ $$i == $$j ]; then \
found=1; \
fi; \
done; \
if [ $$found == 0 ]; then \
rm -r $$i; \
fi; \
done
#######################################################
#
# the sub-dir in the user dir
#
#######################################################
EXEC = tftp
OBJS = tftp.o main.o tftpsubs.o
all: $(EXEC)
$(EXEC): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
$(OBJS): tftpsubs.h
romfs:
$(ROMFSINST) /bin/$(EXEC)
clean:
-rm -f $(EXEC) *.elf *.gdb *.o
#############################################
相关阅读 更多 +