mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
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:
parent
8687f170c3
commit
42851f44b8
2 changed files with 21 additions and 18 deletions
|
|
@ -1,10 +1,28 @@
|
|||
include $(MODDIR)/make/defs.mk
|
||||
include $(MODDIR)/make/rules.mk
|
||||
|
||||
all:
|
||||
# variables
|
||||
#PROJ_H ?= $(PROJECT).h
|
||||
SRC_H += $(PROJ_H)
|
||||
|
||||
# mandatory targets
|
||||
all: $(PROJ_H)
|
||||
clean: clean.include
|
||||
install: install_HDR
|
||||
|
||||
clean.include:
|
||||
rm -rf *.h *~ .*.swp *.done
|
||||
# convenience targets
|
||||
project-header: $(PROJ_H)
|
||||
|
||||
# rules
|
||||
clean.include:
|
||||
rm -rf *.h *~ .*.swp *.done $(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 $@
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue