aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/build.mk
blob: 6f88de3274bd0177b0720bd6c490572e3a4e910e (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
46
47
48
49
50
51
52
53
54
55
BINS_libtests = \
	cxx11 \
	aes \
	ascii85 \
	bits \
	buffer \
	closed_file_input_source \
	concatenate \
	dct_compress \
	dct_uncompress \
	flate \
	hex \
	input_source \
	json \
	lzw \
	main_from_wmain \
	matrix \
	md5 \
	nntree \
	numrange \
	pointer_holder \
	predictors \
	qintc \
	qutil \
	random \
	rc4 \
	runlength \
	sha2 \
	sparse_array

TARGETS_libtests = $(foreach B,$(BINS_libtests),libtests/$(OUTPUT_DIR)/$(call binname,$(B)))

$(TARGETS_libtests): $(TARGETS_libqpdf) $(TARGETS_qpdf)

INCLUDES_libtests = include libqpdf

TC_SRCS_libtests = $(wildcard libqpdf/*.cc) $(wildcard libtests/*.cc) \
	libqpdf/bits.icc

# -----

$(foreach B,$(BINS_libtests),$(eval \
  OBJS_$(B) = $(call src_to_obj,libtests/$(B).cc)))

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

$(foreach B,$(BINS_libtests),$(eval \
  $(OBJS_$(B)): libtests/$(OUTPUT_DIR)/%.$(OBJ): libtests/$(B).cc ; \
	$(call compile,libtests/$(B).cc,$(INCLUDES_libtests))))

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