Release 0.41.92
[vala-gnome.git] / contrib / parvala / parvala.mk
blobcd0938d78e73ca928f9e076581b958f5b99b74f0
1 VALA_AUX = $(DIRECTORY).vala-aux/
3 .PHONY: all-vapi
5 BASENAMES = $(notdir $(basename $(VALAFILES)))
6 VALA_FASTVAPI_FILES = $(foreach f, $(BASENAMES), $(VALA_AUX)$(f).vapi)
7 VALA_FASTVAPI_STAMPS = $(foreach f, $(BASENAMES), $(VALA_AUX)$(f).vapi.stamp)
8 VALA_DEPS = $(foreach f, $(BASENAMES), $(VALA_AUX)$(f).dep)
10 all: $(VALA_DEPS) $(OUT_HFILE)
12 .PRECIOUS: $(VALA_AUX)%.vapi.stamp $(VALA_AUX)%.dep
14 $(VALA_AUX)%.vapi: ;
16 $(VALA_AUX)%.vapi.stamp: $(DIRECTORY)%.vala | $(VALA_AUX)
17 @echo ' GEN '$(@:.stamp=); $(VALAC) --fast-vapi=$(@:.stamp=) $< && touch $@
19 $(VALA_AUX)%.dep: $(DIRECTORY)%.vala | $(VALA_FASTVAPI_STAMPS)
20 @echo ' GEN '$(<:.vala=.c); $(VALAC) -C --deps=$@ $(VALAFLAGS) $(addprefix --use-fast-vapi=,$(subst $(VALA_AUX)$(notdir $(basename $@)).vapi,, $(VALA_FASTVAPI_FILES))) $<
22 $(VALA_AUX):
23 @mkdir -p $(VALA_AUX)
25 include $(wildcard $(VALA_AUX)/*.dep)
27 ifdef OUT_HFILE
28 $(OUT_HFILE) $(addsuffix .vapi,$(OUT_VAPI)): $(VALA_FASTVAPI_FILES) | $(VALA_FASTVAPI_STAMPS)
29 @echo ' GEN '$(OUT_HFILE) $(addsuffix .vapi,$(OUT_VAPI)); $(VALAC) -C -H $(OUT_HFILE) $(addprefix --library=,$(OUT_VAPI)) $(VALAFLAGS) $(addprefix --use-fast-vapi=,$(VALA_FASTVAPI_FILES)) && touch $(OUT_HFILE)
30 endif