have makefile automatically create out/ if it doesn't exist
This commit is contained in:
2
Makefile
2
Makefile
@ -49,12 +49,14 @@ $(PROGRAM): $(OBJS)
|
|||||||
|
|
||||||
|
|
||||||
out/%.d: src/%.c
|
out/%.d: src/%.c
|
||||||
|
@mkdir -p $(@D)
|
||||||
@set -e ; $(RM) $@; \
|
@set -e ; $(RM) $@; \
|
||||||
$(CC) -M $(CFLAGS) $< > $@.$$$$; \
|
$(CC) -M $(CFLAGS) $< > $@.$$$$; \
|
||||||
sed 's,\($*\)\.o[ :]*,out/\1.o $@ : ,g' < $@.$$$$ > $@; \
|
sed 's,\($*\)\.o[ :]*,out/\1.o $@ : ,g' < $@.$$$$ > $@; \
|
||||||
$(RM) $@.$$$$
|
$(RM) $@.$$$$
|
||||||
|
|
||||||
out/%.o: src/%.c
|
out/%.o: src/%.c
|
||||||
|
@mkdir -p $(@D)
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
include $(DEPS)
|
include $(DEPS)
|
||||||
|
|||||||
Reference in New Issue
Block a user