aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 065143fa632a6a0b4b0e300f6a39da491de7c104 (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
.POSIX:

DEVCHECK = @:
UNIMPORTANT_CHECK =

CONFIGFILE = config.mk
include $(CONFIGFILE)

all:

generated.mk: $(CONFIGFILE) icons.mk Makefile check-icon-listing
	$(DEVCHECK) check/find-errors
	$(DEVCHECK) check/find-unlisted-icons
	$(DEVCHECK) check/find-duplicates
	$(DEVCHECK) ./check-icon-listing
	@test ! -e $@ || chmod -- u+w $@
	printf '\043 %s\n' 'This file is generated from Makefile' > $@
	printf '\n%1i$$(DIR_SUFFIX)/%%.png: scalable$$(DIR_SUFFIX)/%%.svg conv\n\t./conv $$@\n' $(SIZES) |\
		sed 's/^[0-9]\+/&x&/' >> $@
	set -e; \
	for size in $(SIZES); do\
		printf '\nALL_SIZE_%i_PNG_ICONS =\\\n' $$size >> $@;\
		sed '/^\s*\('"$$(printf '\043')"'.*\|\)$$/d' < icons.mk | sed 1d | sed 's/\\\?$$/\.png&/' |\
			sed 's/^\s*/&'"$${size}x$${size}"'\$$(DIR_SUFFIX)\//' >> $@;\
	done
	printf '\nALL_PNG_ICONS =' >> $@
	printf ' $$(ALL_SIZE_%i_PNG_ICONS)' $(SIZES) >> $@
	printf '\n' >> $@
	@chmod -- a-w $@

check-icon-listing: check/check-icon-listing.c
	$(CC) -o $@ $< $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)

check: check-icon-listing
	$(UNIMPORTANT_CHECK) check/find-errors
	$(UNIMPORTANT_CHECK) check/find-unlisted-icons
	$(UNIMPORTANT_CHECK) check/find-duplicates
	$(UNIMPORTANT_CHECK) ./check-icon-listing
	+cd apps && $(MAKE) check

clean:
	-rm -rf -- index.theme *.o *.su conv generated.mk scalable-"$(DIR_SUFFIX_)"
	-rm -f -- check-icon-listing
	-for s in $(SIZES); do printf "$${s}x$${s}$(DIR_SUFFIX)\n"; done | xargs rm -rf --
	-+cd apps && $(MAKE) clean

# These are just added so autocompletion works with them
all all-fast all-fast-icons all-apps install uninstall index.theme conv: generated.mk
	+@$(MAKE) -f mk/make-stage-2.mk $@

.DEFAULT:
	+@$(MAKE) generated.mk
	+@$(MAKE) -f mk/make-stage-2.mk $@

.PHONY: all check all-fast all-fast-icons all-apps install uninstall clean