jw-pkg/make/targets-tools.mk
Jan Lindemann 8687f170c3 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.
2009-06-06 14:46:29 +00:00

28 lines
816 B
Makefile

# generic utility modules
# (c) 2001 jannet it services
# contact@jannet.de
# $Id$
include $(MODDIR)/make/rules.mk
all:
clean: objclean textclean localclean profclean
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 $@