makefile - making source in subfolder question -



makefile - making source in subfolder question -

i have makefile compiles *.c files in subfolder:

objects := $(patsubst %.c,%.o,$(wildcard *.c)) cobj: $(objects) $(objects): %.o: %.c $(cc) -c $< -o $@

i having problem trying same parent folder. lets .c files in folder 'csrc'

objects := $(addprefix, csrc/, $(patsubst %.c,%.o,$(wildcard *.c))) cobj: $(objects) $(objects): csrc/%.o: %.c $(cc) -c $< -o $@

i see "nothing cobj... ideas?

your pattern rule csrc/%.o: %.c translates e.g. csrc/foo.o foo.c, not csrc/foo.c. presumably, not want.

why not %.o: %.c?

makefile gnu-make

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -