aboutsummaryrefslogtreecommitdiffstats
path: root/examples/build.mk
blob: 031601ffd5470437b294cbf7c6e38cb2ce0c9f7e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
BINS_examples = \
	pdf-bookmarks \
	pdf-mod-info \
	pdf-npages \
	pdf-double-page-size \
	pdf-invert-images \
	pdf-create \
	pdf-parse-content \
	pdf-split-pages \
	pdf-filter-tokens \
	pdf-count-strings \
	pdf-set-form-values
CBINS_examples = pdf-linearize

TARGETS_examples = $(foreach B,$(BINS_examples) $(CBINS_examples),examples/$(OUTPUT_DIR)/$(call binname,$(B)))

$(TARGETS_examples): $(TARGETS_qpdf)

INCLUDES_examples = include

TC_SRCS_examples = $(wildcard examples/*.cc)

# -----

$(foreach B,$(BINS_examples),$(eval \
  OBJS_$(B) = $(call src_to_obj,examples/$(B).cc)))

$(foreach B,$(CBINS_examples),$(eval \
  OBJS_$(B) = $(call c_src_to_obj,examples/$(B).c)))

ifeq ($(GENDEPS),1)
-include $(foreach B,$(BINS_examples) $(CBINS_examples),$(call obj_to_dep,$(OBJS_$(B))))
endif

$(foreach B,$(BINS_examples),$(eval \
  $(OBJS_$(B)): examples/$(OUTPUT_DIR)/%.$(OBJ): examples/$(B).cc ; \
	$(call compile,examples/$(B).cc,$(INCLUDES_examples))))

$(foreach B,$(CBINS_examples),$(eval \
  $(OBJS_$(B)): examples/$(OUTPUT_DIR)/%.$(OBJ): examples/$(B).c ; \
	$(call c_compile,examples/$(B).c,$(INCLUDES_examples))))

$(foreach B,$(BINS_examples) $(CBINS_examples),$(eval \
  examples/$(OUTPUT_DIR)/$(call binname,$(B)): $(OBJS_$(B)) ; \
	$(call makebin,$(OBJS_$(B)),$$@,$(LDFLAGS_libqpdf) $(LDFLAGS),$(LIBS_libqpdf) $(LIBS))))