Altera_Forum
Honored Contributor
19 years agouClinux makefile
Does anyone know how to create a makefile for a uClinux project consisting several .c and .h files. I am having trouble linking any function to "main"which are not in the same .c file(but in the same application project folder).
For example I am getting an error: ******************************* mpeg2enc.bin(.text+0xf0): In function `main': /cygdrive/c/Anika/uc/strx1/sw/mpg/mpeg2enc.c:70: undefined reference to `putseq' ****************************** putseq is another .c file which is in the same application project but not in the same file(mpeg2enc.c-> main). Right now my makefile looks like this: **********************************# # configurable options# - set DEBUG = 1 to turn on debugging support# DEBUG = 1 PROJ_NAME = mpg INSTALL_DIR = ./build PROGS := mpeg2enc.exe OBJ = mpeg2enc.o conform.o putseq.o putpic.o puthdr.o putmpg.o putvlc.o putbits.o motion.o predict.o readpic.o writepic.o transfrm.o fdctref.o idct.o quantize.o ratectl.o stats.o LIBCDIR := C:\Altera5\kits\bin\eclipse\plugins\com.microtronix.nios2linux.uClibc_1.4.0 UTILSDIR := C:\Altera5\kits\bin\eclipse\plugins\com.microtronix.nios2linux.application_1.4.0 CFLAGS += # # You should not need to modify anything beyond this point# TOPDIR = ./ include Rules.mak ifeq '$(DEBUG)' '1' PROGS += $(PROGS:.exe=.gdb) endif all: $(PROGS) clean: rm -f *.o *% core mpeg2encode mpeg2enc.exe: mpeg2encode coff2exe mpeg2enc mpeg2encode: $(OBJ) $(CFLAGS) -o mpeg2encode $(OBJ) -lm conform.o : conform.c config.h global.h mpeg2enc.h fdctref.o : fdctref.c config.h idct.o : idct.c config.h motion.o : motion.c config.h global.h mpeg2enc.h mpeg2enc.o : mpeg2enc.c config.h global.h mpeg2enc.h predict.o : predict.c config.h global.h mpeg2enc.h putbits.o : putbits.c config.h puthdr.o : puthdr.c config.h global.h mpeg2enc.h putmpg.o : putmpg.c config.h global.h mpeg2enc.h putpic.o : putpic.c config.h global.h mpeg2enc.h putseq.o : putseq.c config.h global.h mpeg2enc.h putvlc.o : putvlc.c config.h global.h mpeg2enc.h vlc.h quantize.o : quantize.c config.h global.h mpeg2enc.h ratectl.o : ratectl.c config.h global.h mpeg2enc.h readpic.o : readpic.c config.h global.h mpeg2enc.h stats.o : stats.c config.h global.h mpeg2enc.h transfrm.o : transfrm.c config.h global.h mpeg2enc.h writepic.o : writepic.c config.h global.h mpeg2enc.h *********************************************** I'll really appreciate if someone could help me in this regard. Anika http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/unsure.gif