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

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -