[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[microblaze-uclinux] Re:How to Write a make file that consists mutible .c files and .h




hello sir
Iam using petalinux-0.40final .I used petalinux-new-app command to create appliaction it suceesfully creates Makefile hello.c 
the result is came.when i use mutile c files letus say 10 cfiles 10 .h files are there how can  i modify the code 
th below is i changed it i got error mutilbel defintions in a file.
 
The source code it consists .c file .h mutile files how i include here .Are the below is enough
 
ifndef PETALINUX
$(error You must source the petalinux/settings.sh script before working with PetaLinux)
endif
# Point to default PetaLinux root directory
ifndef ROOTDIR
ROOTDIR=$(PETALINUX)/software/petalinux-dist
endif
PATH:=$(PATH):$(ROOTDIR)/tools
UCLINUX_BUILD_USER = 1
-include $(ROOTDIR)/.config
-include $(ROOTDIR)/$(CONFIG_LINUXDIR)/.config
LIBCDIR = $(CONFIG_LIBCDIR)
-include $(ROOTDIR)/config.arch
ROMFSDIR=$(ROOTDIR)/romfs
ROMFSINST=$(ROOTDIR)/tools/romfs-inst.sh
APP = ldecod
# Add any other object files to this list below
APP_OBJS = ldecod.o annexb.o cabac.o erc_do_i.o filehandle.o image.o loopFilter.o mbuffer.o nal.o nalucommon.o parsetcommon.o transform8x8.o biaridecod.o context_ini.o erc_do_p.o fmo.o macroblock.o mc_prediction.o nal_part.o output.o rtp.o transform.o block.o erc_api.o errorconcealment.o header.o leaky_bucket.o mb_access.o memalloc.o nalu.o parset.o sei.o vlc.o
all: $(APP)
$(APP): $(APP_OBJS)
 $(CC) $(LDFLAGS) -o $@ $(APP_OBJS) $(LDLIBS)
clean:
 -rm -f $(APP) *.elf *.gdb *.o
.PHONY: romfs image
romfs:
 $(ROMFSINST) $(APP) /bin/$(APP)
image: romfs
 make -C ${PETALINUX}/software/petalinux-dist image
%.o: %.c
 $(CC) -c $(CFLAGS) -o $@ $<

# Targets for the required .config files - if they don't exist, the tree isn't
# configured.  Tell the user this, how to fix it, and exit.
${ROOTDIR}/config.arch ${ROOTDIR}/.config:
 @echo "Error: You must configure the PetaLinux tree before compiling your application"
 @echo ""
 @echo "Change directory to ../../petalinux-dist and 'make menuconfig' or 'make xconfig'"
 @echo ""
 @echo "Once the tree is configured, return to this directory, and re-run make."
 @echo ""
 @exit -1