libutf

UTF-8 library
git clone git://git.suckless.org/libutf
Log | Files | Refs | README | LICENSE

Makefile (1164B)


      1 # See LICENSE file for copyright and license details.
      2 
      3 include config.mk
      4 
      5 SRC = rune.c runetype.c utf.c
      6 OBJ = $(SRC:.c=.o)
      7 
      8 LIB = libutf.a
      9 INC = utf.h
     10 
     11 all: $(LIB) utftest
     12 
     13 $(LIB): $(OBJ)
     14 	$(AR) -rcs $@ $(OBJ)
     15 
     16 utftest: utftest.o $(LIB)
     17 	$(CC) $(LDFLAGS) -o $@ utftest.o $(LIB)
     18 
     19 .c.o:
     20 	$(CC) $(CFLAGS) -c $<
     21 
     22 runetypebody.h: mkrunetype.awk UnicodeData-$(UNICODE).txt
     23 	$(AWK) -f mkrunetype.awk UnicodeData-$(UNICODE).txt > $@
     24 
     25 install: $(LIB) $(INC) $(MAN)
     26 	@echo @ install libutf to $(DESTDIR)$(PREFIX)
     27 	@mkdir -p $(DESTDIR)$(PREFIX)/lib
     28 	@cp $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB)
     29 	@mkdir -p $(DESTDIR)$(PREFIX)/include
     30 	@cp $(INC) $(DESTDIR)$(PREFIX)/include/$(INC)
     31 	@mkdir -p $(DESTDIR)$(PREFIX)/share/man/man3
     32 	@cp rune.3 $(DESTDIR)$(PREFIX)/share/man/man3/rune.3
     33 	@sed 's/$$UNICODE/$(UNICODE)/g' isalpharune.3 > $(DESTDIR)$(PREFIX)/share/man/man3/isalpharune.3
     34 
     35 uninstall:
     36 	@echo @ uninstall libutf from $(DESTDIR)$(PREFIX)
     37 	@rm -f $(DESTDIR)$(PREFIX)/lib/$(LIB)
     38 	@rm -f $(DESTDIR)$(PREFIX)/include/$(INC)
     39 	@rm -f $(DESTDIR)$(PREFIX)/share/man/man3/rune.3
     40 	@rm -f $(DESTDIR)$(PREFIX)/share/man/man3/isalpharune.3
     41 
     42 clean:
     43 	rm -f $(LIB) utftest utftest.o $(OBJ)