ii

My fork of https://tools.suckless.org/ii/
git clone https://git.inz.fi/ii
Log | Files | Refs | README | LICENSE

Makefile (1126B)


      1 # See LICENSE file for copyright and license details.
      2 .POSIX:
      3 
      4 include config.mk
      5 
      6 SRC = ii.c
      7 OBJ = $(SRC:.c=.o)
      8 
      9 IICFLAGS = -DVERSION=\"$(VERSION)\" -D_DEFAULT_SOURCE $(CFLAGS)
     10 
     11 all: ii
     12 
     13 options:
     14 	@echo ii build options:
     15 	@echo "CFLAGS   = $(IICFLAGS)"
     16 	@echo "LDFLAGS  = $(LDFLAGS)"
     17 	@echo "CC       = $(CC)"
     18 
     19 .c.o:
     20 	$(CC) $(IICFLAGS) -c $<
     21 
     22 ii: $(OBJ) $(LIBS)
     23 	$(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
     24 
     25 $(OBJ): arg.h
     26 
     27 install: all
     28 	mkdir -p $(DESTDIR)$(PREFIX)/bin
     29 	mkdir -p $(DESTDIR)$(MANPREFIX)/man1
     30 	mkdir -p $(DESTDIR)$(DOCPREFIX)/ii
     31 	install -m 644 CHANGES README FAQ LICENSE $(DESTDIR)$(DOCPREFIX)/ii
     32 	install -m 775 ii $(DESTDIR)$(PREFIX)/bin
     33 	sed "s/VERSION/$(VERSION)/g" < ii.1 > $(DESTDIR)$(MANPREFIX)/man1/ii.1
     34 	chmod 644 $(DESTDIR)$(MANPREFIX)/man1/ii.1
     35 
     36 uninstall: all
     37 	rm -f $(DESTDIR)$(MANPREFIX)/man1/ii.1 $(DESTDIR)$(PREFIX)/bin/ii
     38 	rm -rf $(DESTDIR)$(DOCPREFIX)/ii
     39 
     40 dist: clean
     41 	mkdir -p ii-$(VERSION)
     42 	cp -R Makefile CHANGES README FAQ LICENSE strlcpy.c arg.h \
     43 		config.mk ii.c ii.1 ii-$(VERSION)
     44 	tar -cf ii-$(VERSION).tar ii-$(VERSION)
     45 	gzip ii-$(VERSION).tar
     46 	rm -rf ii-$(VERSION)
     47 
     48 clean:
     49 	rm -f ii *.o