targets-tools.mk: Support PROJ_H

Support the PROJ_H variable, which is undefined by default.

PROJ_H is +=-added to SRC_H, thus solving failure to produce .dep.mk and copying
the stuff to the include directory.

I suppose this would be most cleanly handled in include.mk.
This commit is contained in:
Jan Lindemann 2009-06-06 14:46:29 +00:00 committed by Jan Lindemann
commit 8687f170c3

View file

@ -11,9 +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-header: $(PROJ_H)
$(PROJECT).h: $(filter-out $(PROJECT).h $(PROJECT)/$(PROJECT).h,$(wildcard *.h $(PROJECT)/*.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
@ -21,3 +25,4 @@ $(PROJECT).h: $(filter-out $(PROJECT).h $(PROJECT)/$(PROJECT).h,$(wildcard *.h $
echo >> $@.tmp
echo "#endif /* #ifndef _$(PROJECT_CAPNAME)_H */" >> $@.tmp
mv $@.tmp $@