summaryrefslogtreecommitdiff
path: root/xournal.mk
blob: 2ac20093a6879d7f6b4aba8e7bcb09fc93a5a4c4 (plain)
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
# -*- make -*-
# Started in  2023 by Eugeniy Mikhailov, <evgmik@gmail.com>
# Processing of xournal files 

CLEAN_TARGETS      += clean_xournal
REAL_CLEAN_TARGETS += real_clean_xournal

dest_dir_xournal ?= $(dest_dir)
destination_dirs += $(dest_dir_xournal)

xournal_files  = $(wildcard *.xopp)
pdf_from_xournal  = $(xournal_files:%.xopp=%.pdf)	

xournal_src_dest_targets = $(xournal_files:%=$(dest_dir_xournal)/%)
pdf_from_xournal_dest_targets = $(pdf_from_xournal:%=$(dest_dir_xournal)/%)

XORNAL = xournalpp

pdf_xournal:  $(pdf_from_xournal)
$(pdf_from_xournal): %.pdf : %.xopp
	$(XORNAL) $< --create-pdf=$@

install_xournal_src: $(xournal_src_dest_targets)
$(xournal_src_dest_targets): $(dest_dir_xournal)/% : % | $(dest_dir_xournal)
ifneq ($(strip $(xournal_files)),)
	$(INSTALL) -m 0644 '$<' '$@'
endif

install_pdf_xournal: $(pdf_from_xournal_dest_targets)
$(pdf_from_xournal_dest_targets): $(dest_dir_xournal)/% : % | $(dest_dir_xournal)
ifneq ($(strip $(pdf_from_xournal)),)
	$(INSTALL) -m 0644 '$<' '$@'
endif

clean_xournal:
	
real_clean_xournal:
ifneq ($(strip $(pdf_from_xournal)),)
	rm -f $(pdf_from_xournal)
endif