make: Header generation targets-tools.mk -> include.mk

Move project header generation mechanics from targets-tools.mk into
include.mk.
This commit is contained in:
Jan Lindemann 2009-06-06 15:15:58 +00:00 committed by Jan Lindemann
commit 42851f44b8
2 changed files with 21 additions and 18 deletions

View file

@ -11,18 +11,3 @@ install: $(ALL)
$(LIB_SO): $(OBJ)
all.done: $(PREREQ_DONE) $(BUILD_HDR) $(BUILD_EXE_SH) $(MEMBERS) $(LIB_A) $(LIB_SO)
project-header: $(PROJ_H)
# I think this is most cleanly handled in include.mk
#PROJ_H ?= $(PROJECT).h
SRC_H += $(PROJ_H)
$(PROJ_H): $(filter-out $(PROJ_H) $(PROJECT)/$(PROJ_H),$(wildcard *.h $(PROJECT)/*.h))
echo "#ifndef _$(PROJECT_CAPNAME)_H" > $@.tmp
echo "#define _$(PROJECT_CAPNAME)_H" >> $@.tmp
echo >> $@.tmp
for h in $(sort $(patsubst $(PROJECT)/%,%,$^)); do echo "#include <$(PROJECT)/$$h>"; done >> $@.tmp
echo >> $@.tmp
echo "#endif /* #ifndef _$(PROJECT_CAPNAME)_H */" >> $@.tmp
mv $@.tmp $@