SRCS = $(shell find -name '*.c')
OBJS = $(addsuffix .o,$(basename $(SRCS)))
CC = gcc
CFLAGS = -m32 -Wall -g -I include -Werror -D_GNU_SOURCE -std=gnu99
run_command = $(if $(V),$(2),@echo $(1);$(2))
all: $(OBJS)
%.o: %.c
$(call run_command,"CC $^",$(CC) $(CFLAGS) \
$(if $(shell if [ -f $(dir $^)/Makefile.conf ]; then echo .; fi),$(shell cd $(dir $^); echo -e "$$(< Makefile.conf)\necho \$$CC_FLAGS" | sh -s),) \
$(addprefix -I,$(addprefix $(dir $^),. include)) -c -o $@ $^)
clean:
-rm $(OBJS) 2> /dev/null
doc:
for lang in german english; do \
sed -e "s/%LANG%/$$lang/g#" doc/doxyfile.in > doc/doxyfile; \
doxygen doc/doxyfile; \
done
.PHONY: clean doc
-
+ Apparently it is allowed to specify additional CFLAGS (as "CC_FLAGS") in a file named Makefile.conf (formatted as a shell script) in a driver's root directory; or at least ext2 just does this. This patch makes the CDI Makefile take the additional flags from that file into account, if present. Thanks to this, the ext2 driver can be compiled. Signed-off-by:
Max Reitz <max@tyndur.org> Acked-by:
Kevin Wolf <kevin@tyndur.org> Signed-off-by:
Kevin Wolf <kevin@tyndur.org>
e347a1a6