libgrapheme

Freestanding C library for unicode string handling
git clone https://git.sinitax.com/suckless/libgrapheme
Log | Files | Refs | README | LICENSE | sfeed.txt

Makefile (17112B)


      1# See LICENSE file for copyright and license details
      2# libgrapheme - unicode string library
      3.POSIX:
      4.SUFFIXES:
      5
      6VERSION_MAJOR = 2
      7VERSION_MINOR = 0
      8VERSION_PATCH = 1
      9UNICODE_VERSION = 15.0.0
     10MAN_DATE = 2022-10-06
     11
     12include config.mk
     13
     14VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
     15
     16BENCHMARK =\
     17	benchmark/bidirectional\
     18	benchmark/case\
     19	benchmark/character\
     20	benchmark/sentence\
     21	benchmark/line\
     22	benchmark/utf8-decode\
     23	benchmark/word\
     24
     25DATA =\
     26	data/BidiBrackets.txt\
     27	data/BidiCharacterTest.txt\
     28	data/BidiMirroring.txt\
     29	data/BidiTest.txt\
     30	data/DerivedBidiClass.txt\
     31	data/DerivedCoreProperties.txt\
     32	data/EastAsianWidth.txt\
     33	data/emoji-data.txt\
     34	data/GraphemeBreakProperty.txt\
     35	data/GraphemeBreakTest.txt\
     36	data/LICENSE\
     37	data/LineBreak.txt\
     38	data/LineBreakTest.txt\
     39	data/SentenceBreakProperty.txt\
     40	data/SentenceBreakTest.txt\
     41	data/SpecialCasing.txt\
     42	data/UnicodeData.txt\
     43	data/WordBreakProperty.txt\
     44	data/WordBreakTest.txt\
     45
     46GEN =\
     47	gen/bidirectional\
     48	gen/bidirectional-test\
     49	gen/case\
     50	gen/character\
     51	gen/character-test\
     52	gen/line\
     53	gen/line-test\
     54	gen/sentence\
     55	gen/sentence-test\
     56	gen/word\
     57	gen/word-test\
     58
     59SRC =\
     60	src/bidirectional\
     61	src/case\
     62	src/character\
     63	src/line\
     64	src/sentence\
     65	src/utf8\
     66	src/util\
     67	src/word\
     68
     69TEST =\
     70	test/bidirectional\
     71	test/case\
     72	test/character\
     73	test/line\
     74	test/sentence\
     75	test/utf8-decode\
     76	test/utf8-encode\
     77	test/word\
     78
     79MAN_TEMPLATE =\
     80	man/template/is_case.sh\
     81	man/template/next_break.sh\
     82	man/template/to_case.sh\
     83
     84MAN3 =\
     85	man/grapheme_decode_utf8\
     86	man/grapheme_encode_utf8\
     87	man/grapheme_is_character_break\
     88	man/grapheme_is_uppercase\
     89	man/grapheme_is_uppercase_utf8\
     90	man/grapheme_is_lowercase\
     91	man/grapheme_is_lowercase_utf8\
     92	man/grapheme_is_titlecase\
     93	man/grapheme_is_titlecase_utf8\
     94	man/grapheme_next_character_break\
     95	man/grapheme_next_line_break\
     96	man/grapheme_next_sentence_break\
     97	man/grapheme_next_word_break\
     98	man/grapheme_next_character_break_utf8\
     99	man/grapheme_next_line_break_utf8\
    100	man/grapheme_next_sentence_break_utf8\
    101	man/grapheme_next_word_break_utf8\
    102	man/grapheme_to_uppercase\
    103	man/grapheme_to_uppercase_utf8\
    104	man/grapheme_to_lowercase\
    105	man/grapheme_to_lowercase_utf8\
    106	man/grapheme_to_titlecase\
    107	man/grapheme_to_titlecase_utf8\
    108
    109MAN7 =\
    110	man/libgrapheme\
    111
    112all: data/LICENSE $(MAN3:=.3) $(MAN7:=.7) $(ANAME) $(SONAME)
    113
    114data/BidiBrackets.txt:
    115	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/BidiBrackets.txt
    116
    117data/BidiCharacterTest.txt:
    118	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/BidiCharacterTest.txt
    119
    120data/BidiMirroring.txt:
    121	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/BidiMirroring.txt
    122
    123data/BidiTest.txt:
    124	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/BidiTest.txt
    125
    126data/DerivedBidiClass.txt:
    127	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/extracted/DerivedBidiClass.txt
    128
    129data/DerivedCoreProperties.txt:
    130	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/DerivedCoreProperties.txt
    131
    132data/EastAsianWidth.txt:
    133	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/EastAsianWidth.txt
    134
    135data/emoji-data.txt:
    136	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/emoji/emoji-data.txt
    137
    138data/GraphemeBreakProperty.txt:
    139	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/auxiliary/GraphemeBreakProperty.txt
    140
    141data/GraphemeBreakTest.txt:
    142	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/auxiliary/GraphemeBreakTest.txt
    143
    144data/LICENSE:
    145	wget -O $@ https://www.unicode.org/license.txt
    146
    147data/LineBreak.txt:
    148	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/LineBreak.txt
    149
    150data/LineBreakTest.txt:
    151	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/auxiliary/LineBreakTest.txt
    152
    153data/SentenceBreakProperty.txt:
    154	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/auxiliary/SentenceBreakProperty.txt
    155
    156data/SentenceBreakTest.txt:
    157	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/auxiliary/SentenceBreakTest.txt
    158
    159data/SpecialCasing.txt:
    160	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/SpecialCasing.txt
    161
    162data/UnicodeData.txt:
    163	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/UnicodeData.txt
    164
    165data/WordBreakProperty.txt:
    166	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/auxiliary/WordBreakProperty.txt
    167
    168data/WordBreakTest.txt:
    169	wget -O $@ https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/auxiliary/WordBreakTest.txt
    170
    171benchmark/bidirectional.o: benchmark/bidirectional.c Makefile config.mk gen/bidirectional-test.h grapheme.h benchmark/util.h
    172benchmark/case.o: benchmark/case.c Makefile config.mk gen/word-test.h grapheme.h benchmark/util.h
    173benchmark/character.o: benchmark/character.c Makefile config.mk gen/character-test.h grapheme.h benchmark/util.h
    174benchmark/line.o: benchmark/line.c Makefile config.mk gen/line-test.h grapheme.h benchmark/util.h
    175benchmark/utf8-decode.o: benchmark/utf8-decode.c Makefile config.mk gen/character-test.h grapheme.h benchmark/util.h
    176benchmark/sentence.o: benchmark/sentence.c Makefile config.mk gen/sentence-test.h grapheme.h benchmark/util.h
    177benchmark/util.o: benchmark/util.c Makefile config.mk benchmark/util.h
    178benchmark/word.o: benchmark/word.c Makefile config.mk gen/word-test.h grapheme.h benchmark/util.h
    179gen/bidirectional.o: gen/bidirectional.c Makefile config.mk gen/util.h
    180gen/bidirectional-test.o: gen/bidirectional-test.c Makefile config.mk gen/util.h
    181gen/case.o: gen/case.c Makefile config.mk gen/util.h
    182gen/character.o: gen/character.c Makefile config.mk gen/util.h
    183gen/character-test.o: gen/character-test.c Makefile config.mk gen/util.h
    184gen/line.o: gen/line.c Makefile config.mk gen/util.h
    185gen/line-test.o: gen/line-test.c Makefile config.mk gen/util.h
    186gen/sentence.o: gen/sentence.c Makefile config.mk gen/util.h
    187gen/sentence-test.o: gen/sentence-test.c Makefile config.mk gen/util.h
    188gen/word.o: gen/word.c Makefile config.mk gen/util.h
    189gen/word-test.o: gen/word-test.c Makefile config.mk gen/util.h
    190gen/util.o: gen/util.c Makefile config.mk gen/util.h
    191src/bidirectional.o: src/bidirectional.c Makefile config.mk gen/bidirectional.h grapheme.h src/util.h
    192src/case.o: src/case.c Makefile config.mk gen/case.h grapheme.h src/util.h
    193src/character.o: src/character.c Makefile config.mk gen/character.h grapheme.h src/util.h
    194src/line.o: src/line.c Makefile config.mk gen/line.h grapheme.h src/util.h
    195src/sentence.o: src/sentence.c Makefile config.mk gen/sentence.h grapheme.h src/util.h
    196src/utf8.o: src/utf8.c Makefile config.mk grapheme.h
    197src/util.o: src/util.c Makefile config.mk gen/types.h grapheme.h src/util.h
    198src/word.o: src/word.c Makefile config.mk gen/word.h grapheme.h src/util.h
    199test/bidirectional.o: test/bidirectional.c Makefile config.mk gen/bidirectional-test.h grapheme.h test/util.h
    200test/case.o: test/case.c Makefile config.mk grapheme.h test/util.h
    201test/character.o: test/character.c Makefile config.mk gen/character-test.h grapheme.h test/util.h
    202test/line.o: test/line.c Makefile config.mk gen/line-test.h grapheme.h test/util.h
    203test/sentence.o: test/sentence.c Makefile config.mk gen/sentence-test.h grapheme.h test/util.h
    204test/utf8-encode.o: test/utf8-encode.c Makefile config.mk grapheme.h test/util.h
    205test/utf8-decode.o: test/utf8-decode.c Makefile config.mk grapheme.h test/util.h
    206test/util.o: test/util.c Makefile config.mk test/util.h
    207test/word.o: test/word.c Makefile config.mk gen/word-test.h grapheme.h test/util.h
    208
    209benchmark/bidirectional$(BINSUFFIX): benchmark/bidirectional.o benchmark/util.o $(ANAME)
    210benchmark/case$(BINSUFFIX): benchmark/case.o benchmark/util.o $(ANAME)
    211benchmark/character$(BINSUFFIX): benchmark/character.o benchmark/util.o $(ANAME)
    212benchmark/line$(BINSUFFIX): benchmark/line.o benchmark/util.o $(ANAME)
    213benchmark/sentence$(BINSUFFIX): benchmark/sentence.o benchmark/util.o $(ANAME)
    214benchmark/utf8-decode$(BINSUFFIX): benchmark/utf8-decode.o benchmark/util.o $(ANAME)
    215benchmark/word$(BINSUFFIX): benchmark/word.o benchmark/util.o $(ANAME)
    216gen/bidirectional$(BINSUFFIX): gen/bidirectional.o gen/util.o
    217gen/bidirectional-test$(BINSUFFIX): gen/bidirectional-test.o gen/util.o
    218gen/case$(BINSUFFIX): gen/case.o gen/util.o
    219gen/character$(BINSUFFIX): gen/character.o gen/util.o
    220gen/character-test$(BINSUFFIX): gen/character-test.o gen/util.o
    221gen/line$(BINSUFFIX): gen/line.o gen/util.o
    222gen/line-test$(BINSUFFIX): gen/line-test.o gen/util.o
    223gen/sentence$(BINSUFFIX): gen/sentence.o gen/util.o
    224gen/sentence-test$(BINSUFFIX): gen/sentence-test.o gen/util.o
    225gen/word$(BINSUFFIX): gen/word.o gen/util.o
    226gen/word-test$(BINSUFFIX): gen/word-test.o gen/util.o
    227test/bidirectional$(BINSUFFIX): test/bidirectional.o test/util.o $(ANAME)
    228test/case$(BINSUFFIX): test/case.o test/util.o $(ANAME)
    229test/character$(BINSUFFIX): test/character.o test/util.o $(ANAME)
    230test/line$(BINSUFFIX): test/line.o test/util.o $(ANAME)
    231test/sentence$(BINSUFFIX): test/sentence.o test/util.o $(ANAME)
    232test/utf8-encode$(BINSUFFIX): test/utf8-encode.o test/util.o $(ANAME)
    233test/utf8-decode$(BINSUFFIX): test/utf8-decode.o test/util.o $(ANAME)
    234test/word$(BINSUFFIX): test/word.o test/util.o $(ANAME)
    235
    236gen/bidirectional.h: data/BidiBrackets.txt data/BidiMirroring.txt data/DerivedBidiClass.txt data/UnicodeData.txt gen/bidirectional$(BINSUFFIX)
    237gen/bidirectional-test.h: data/BidiCharacterTest.txt data/BidiTest.txt gen/bidirectional-test$(BINSUFFIX)
    238gen/case.h: data/DerivedCoreProperties.txt data/UnicodeData.txt data/SpecialCasing.txt gen/case$(BINSUFFIX)
    239gen/character.h: data/emoji-data.txt data/GraphemeBreakProperty.txt gen/character$(BINSUFFIX)
    240gen/character-test.h: data/GraphemeBreakTest.txt gen/character-test$(BINSUFFIX)
    241gen/line.h: data/emoji-data.txt data/EastAsianWidth.txt data/LineBreak.txt gen/line$(BINSUFFIX)
    242gen/line-test.h: data/LineBreakTest.txt gen/line-test$(BINSUFFIX)
    243gen/sentence.h: data/SentenceBreakProperty.txt gen/sentence$(BINSUFFIX)
    244gen/sentence-test.h: data/SentenceBreakTest.txt gen/sentence-test$(BINSUFFIX)
    245gen/word.h: data/WordBreakProperty.txt gen/word$(BINSUFFIX)
    246gen/word-test.h: data/WordBreakTest.txt gen/word-test$(BINSUFFIX)
    247
    248man/grapheme_is_character_break.3: man/grapheme_is_character_break.sh Makefile config.mk
    249man/grapheme_is_uppercase.3: man/grapheme_is_uppercase.sh man/template/is_case.sh Makefile config.mk
    250man/grapheme_is_uppercase_utf8.3: man/grapheme_is_uppercase_utf8.sh man/template/is_case.sh Makefile config.mk
    251man/grapheme_is_lowercase.3: man/grapheme_is_lowercase.sh man/template/is_case.sh Makefile config.mk
    252man/grapheme_is_lowercase_utf8.3: man/grapheme_is_lowercase_utf8.sh man/template/is_case.sh Makefile config.mk
    253man/grapheme_is_titlecase.3: man/grapheme_is_titlecase.sh man/template/is_case.sh Makefile config.mk
    254man/grapheme_is_titlecase_utf8.3: man/grapheme_is_titlecase_utf8.sh man/template/is_case.sh Makefile config.mk
    255man/grapheme_next_character_break.3: man/grapheme_next_character_break.sh man/template/next_break.sh Makefile config.mk
    256man/grapheme_next_line_break.3: man/grapheme_next_line_break.sh man/template/next_break.sh Makefile config.mk
    257man/grapheme_next_sentence_break.3: man/grapheme_next_sentence_break.sh man/template/next_break.sh Makefile config.mk
    258man/grapheme_next_word_break.3: man/grapheme_next_word_break.sh man/template/next_break.sh Makefile config.mk
    259man/grapheme_next_character_break_utf8.3: man/grapheme_next_character_break_utf8.sh man/template/next_break.sh Makefile config.mk
    260man/grapheme_next_line_break_utf8.3: man/grapheme_next_line_break_utf8.sh man/template/next_break.sh Makefile config.mk
    261man/grapheme_next_sentence_break_utf8.3: man/grapheme_next_sentence_break_utf8.sh man/template/next_break.sh Makefile config.mk
    262man/grapheme_next_word_break_utf8.3: man/grapheme_next_word_break_utf8.sh man/template/next_break.sh Makefile config.mk
    263man/grapheme_to_uppercase.3: man/grapheme_to_uppercase.sh man/template/to_case.sh Makefile config.mk
    264man/grapheme_to_lowercase.3: man/grapheme_to_lowercase.sh man/template/to_case.sh Makefile config.mk
    265man/grapheme_to_titlecase.3: man/grapheme_to_titlecase.sh man/template/to_case.sh Makefile config.mk
    266man/grapheme_to_uppercase_utf8.3: man/grapheme_to_uppercase_utf8.sh man/template/to_case.sh Makefile config.mk
    267man/grapheme_to_lowercase_utf8.3: man/grapheme_to_lowercase_utf8.sh man/template/to_case.sh Makefile config.mk
    268man/grapheme_to_titlecase_utf8.3: man/grapheme_to_titlecase_utf8.sh man/template/to_case.sh Makefile config.mk
    269man/grapheme_decode_utf8.3: man/grapheme_decode_utf8.sh Makefile config.mk
    270man/grapheme_encode_utf8.3: man/grapheme_encode_utf8.sh Makefile config.mk
    271
    272man/libgrapheme.7: man/libgrapheme.sh Makefile config.mk
    273
    274$(GEN:=.o) gen/util.o:
    275	$(BUILD_CC) -c -o $@ $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) $(@:.o=.c)
    276
    277$(BENCHMARK:=.o) benchmark/util.o $(TEST:=.o) test/util.o:
    278	$(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(@:.o=.c)
    279
    280$(SRC:=.o):
    281	$(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(SHFLAGS) $(@:.o=.c)
    282
    283$(BENCHMARK:=$(BINSUFFIX)):
    284	$(CC) -o $@ $(LDFLAGS) $(@:$(BINSUFFIX)=.o) benchmark/util.o $(ANAME) -lutf8proc
    285
    286$(GEN:=$(BINSUFFIX)):
    287	$(BUILD_CC) -o $@ $(BUILD_LDFLAGS) $(@:$(BINSUFFIX)=.o) gen/util.o
    288
    289$(TEST:=$(BINSUFFIX)):
    290	$(CC) -o $@ $(LDFLAGS) $(@:$(BINSUFFIX)=.o) test/util.o $(ANAME)
    291
    292$(GEN:=.h):
    293	$(@:.h=$(BINSUFFIX)) > $@
    294
    295$(ANAME): $(SRC:=.o)
    296	$(AR) -rc $@ $?
    297	$(RANLIB) $@
    298
    299$(SONAME): $(SRC:=.o)
    300	$(CC) -o $@ $(SOFLAGS) $(LDFLAGS) $(SRC:=.o)
    301
    302$(MAN3:=.3):
    303	SH="$(SH)" MAN_DATE="$(MAN_DATE)" UNICODE_VERSION="$(UNICODE_VERSION)" $(SH) $(@:.3=.sh) > $@
    304
    305$(MAN7:=.7):
    306	SH="$(SH)" MAN_DATE="$(MAN_DATE)" UNICODE_VERSION="$(UNICODE_VERSION)" $(SH) $(@:.7=.sh) > $@
    307
    308benchmark: $(BENCHMARK:=$(BINSUFFIX))
    309	for m in $(BENCHMARK:=$(BINSUFFIX)); do ./$$m; done
    310
    311check: test
    312
    313test: $(TEST:=$(BINSUFFIX))
    314	for m in $(TEST:=$(BINSUFFIX)); do ./$$m; done
    315
    316install: all
    317	mkdir -p "$(DESTDIR)$(LIBPREFIX)"
    318	mkdir -p "$(DESTDIR)$(INCPREFIX)"
    319	mkdir -p "$(DESTDIR)$(MANPREFIX)/man3"
    320	mkdir -p "$(DESTDIR)$(MANPREFIX)/man7"
    321	cp -f $(MAN3:=.3) "$(DESTDIR)$(MANPREFIX)/man3"
    322	cp -f $(MAN7:=.7) "$(DESTDIR)$(MANPREFIX)/man7"
    323	cp -f $(ANAME) "$(DESTDIR)$(LIBPREFIX)"
    324	cp -f $(SONAME) "$(DESTDIR)$(LIBPREFIX)/$(SONAME)"
    325	if [ "$(SOSYMLINK)" = "true" ]; then i=0; while [ "$$i" -le $(VERSION_MINOR) ]; do ln -sf "$(SONAME)" "$(DESTDIR)$(LIBPREFIX)/libgrapheme.so.$(VERSION_MAJOR).$$i"; i=$$((i+1)); done; fi
    326	if [ "$(SOSYMLINK)" = "true" ]; then ln -sf "$(SONAME)" "$(DESTDIR)$(LIBPREFIX)/libgrapheme.so.$(VERSION_MAJOR)"; fi
    327	if [ "$(SOSYMLINK)" = "true" ]; then ln -sf "$(SONAME)" "$(DESTDIR)$(LIBPREFIX)/libgrapheme.so"; fi
    328	cp -f grapheme.h "$(DESTDIR)$(INCPREFIX)"
    329	if ! [ -z "$(LDCONFIG)" ]; then $(SHELL) -c "$(LDCONFIG)"; fi
    330	if ! [ -z "$(PCPREFIX)" ]; then mkdir -p "$(DESTDIR)$(PCPREFIX)"; printf "Name: libgrapheme\nDescription: Unicode string library\nURL: https://libs.suckless.org/libgrapheme/\nVersion: $(VERSION)\nCflags: -I$(INCPREFIX)\nLibs: -L$(LIBPREFIX) -lgrapheme\n" > "$(DESTDIR)$(PCPREFIX)/libgrapheme.pc"; fi
    331
    332uninstall:
    333	for m in $(MAN3:=.3); do rm -f "$(DESTDIR)$(MANPREFIX)/man3/`basename $$m`"; done
    334	for m in $(MAN7:=.7); do rm -f "$(DESTDIR)$(MANPREFIX)/man7/`basename $$m`"; done
    335	rm -f "$(DESTDIR)$(LIBPREFIX)/$(ANAME)"
    336	rm -f "$(DESTDIR)$(LIBPREFIX)/$(SONAME)"
    337	if [ "$(SOSYMLINK)" = "true" ]; then i=0; while [ "$$i" -le $(VERSION_MINOR) ]; do rm -f "$(DESTDIR)$(LIBPREFIX)/libgrapheme.so.$(VERSION_MAJOR).$$i"; i=$$((i+1)); done; fi
    338	if [ "$(SOSYMLINK)" = "true" ]; then rm -f "$(DESTDIR)$(LIBPREFIX)/libgrapheme.so.$(VERSION_MAJOR)"; fi
    339	if [ "$(SOSYMLINK)" = "true" ]; then rm -f "$(DESTDIR)$(LIBPREFIX)/libgrapheme.so"; fi
    340	rm -f "$(DESTDIR)$(INCPREFIX)/grapheme.h"
    341	if ! [ -z "$(LDCONFIG)" ]; then $(SHELL) -c "$(LDCONFIG)"; fi
    342	if ! [ -z "$(PCPREFIX)" ]; then rm -f "$(DESTDIR)$(PCPREFIX)/libgrapheme.pc"; fi
    343
    344clean:
    345	rm -f $(BENCHMARK:=.o) benchmark/util.o $(BENCHMARK:=$(BINSUFFIX)) $(GEN:=.h) $(GEN:=.o) gen/util.o $(GEN:=$(BINSUFFIX)) $(SRC:=.o) src/util.o $(TEST:=.o) test/util.o $(TEST:=$(BINSUFFIX)) $(ANAME) $(SONAME) $(MAN3:=.3) $(MAN7:=.7)
    346
    347clean-data:
    348	rm -f $(DATA)
    349
    350dist:
    351	rm -rf "libgrapheme-$(VERSION)"
    352	mkdir "libgrapheme-$(VERSION)"
    353	for m in benchmark data gen man man/template src test; do mkdir "libgrapheme-$(VERSION)/$$m"; done
    354	cp config.mk configure grapheme.h LICENSE Makefile README "libgrapheme-$(VERSION)"
    355	cp $(BENCHMARK:=.c) benchmark/util.c benchmark/util.h "libgrapheme-$(VERSION)/benchmark"
    356	cp $(DATA) "libgrapheme-$(VERSION)/data"
    357	cp $(GEN:=.c) gen/util.c gen/types.h gen/util.h "libgrapheme-$(VERSION)/gen"
    358	cp $(MAN3:=.sh) $(MAN7:=.sh) "libgrapheme-$(VERSION)/man"
    359	cp $(MAN_TEMPLATE) "libgrapheme-$(VERSION)/man/template"
    360	cp $(SRC:=.c) src/util.h "libgrapheme-$(VERSION)/src"
    361	cp $(TEST:=.c) test/util.c test/util.h "libgrapheme-$(VERSION)/test"
    362	tar -cf - "libgrapheme-$(VERSION)" | gzip -c > "libgrapheme-$(VERSION).tar.gz"
    363	rm -rf "libgrapheme-$(VERSION)"
    364
    365format:
    366	clang-format -i grapheme.h $(BENCHMARK:=.c) benchmark/util.c benchmark/util.h $(GEN:=.c) gen/util.c gen/types.h gen/util.h $(SRC:=.c) src/util.h $(TEST:=.c) test/util.c test/util.h
    367
    368.PHONY: all benchmark check clean clean-data dist format install test uninstall