targets-tools.mk: Add target project-header

This commit is contained in:
Jan Lindemann 2009-06-06 14:10:08 +00:00 committed by Jan Lindemann
commit 95bb24541f

View file

@ -11,3 +11,13 @@ install: $(ALL)
$(LIB_SO): $(OBJ)
all.done: $(PREREQ_DONE) $(BUILD_HDR) $(BUILD_EXE_SH) $(MEMBERS) $(LIB_A) $(LIB_SO)
project-header: $(PROJECT).h
$(PROJECT).h: $(filter-out $(PROJECT).h,$(wildcard *.h))
echo "#ifndef _$(PROJECT_CAPNAME)_H" > $@.tmp
echo "#define _$(PROJECT_CAPNAME)_H" >> $@.tmp
echo >> $@.tmp
for h in $^; do echo "#include <$(PROJECT)/$$h>"; done >> $@.tmp
echo >> $@.tmp
echo "#endif /* #ifndef _$(PROJECT_CAPNAME)_H */" >> $@.tmp
mv $@.tmp $@