2017-06-02 10:54:54 +03:00
|
|
|
# See LICENSE file for copyright and license details.
|
2018-05-29 19:27:36 +03:00
|
|
|
.POSIX:
|
|
|
|
|
2005-12-19 16:39:54 +03:00
|
|
|
include config.mk
|
|
|
|
|
2018-05-29 19:34:52 +03:00
|
|
|
SRC = ii.c
|
2018-05-29 19:27:36 +03:00
|
|
|
OBJ = $(SRC:.c=.o)
|
|
|
|
|
|
|
|
IICFLAGS = -DVERSION=\"$(VERSION)\" -D_DEFAULT_SOURCE $(CFLAGS)
|
2005-12-19 16:39:54 +03:00
|
|
|
|
2017-06-02 10:54:54 +03:00
|
|
|
all: ii
|
2005-12-19 16:39:54 +03:00
|
|
|
|
|
|
|
options:
|
|
|
|
@echo ii build options:
|
2018-05-29 19:27:36 +03:00
|
|
|
@echo "CFLAGS = $(IICFLAGS)"
|
|
|
|
@echo "LDFLAGS = $(LDFLAGS)"
|
|
|
|
@echo "CC = $(CC)"
|
2005-12-19 16:39:54 +03:00
|
|
|
|
2017-06-02 10:54:54 +03:00
|
|
|
.c.o:
|
2018-05-29 19:27:36 +03:00
|
|
|
$(CC) $(IICFLAGS) -c $<
|
2005-12-19 16:39:54 +03:00
|
|
|
|
2018-05-29 19:34:52 +03:00
|
|
|
ii: $(OBJ) $(LIBS)
|
2018-05-29 19:27:36 +03:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
|
2005-12-19 16:39:54 +03:00
|
|
|
|
2018-05-29 19:27:36 +03:00
|
|
|
$(OBJ): arg.h
|
2017-12-04 00:17:36 +03:00
|
|
|
|
2005-12-19 16:39:54 +03:00
|
|
|
install: all
|
2018-05-29 19:27:36 +03:00
|
|
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
|
|
|
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
|
|
|
|
mkdir -p $(DESTDIR)$(DOCPREFIX)/ii
|
|
|
|
install -m 644 CHANGES README FAQ LICENSE $(DESTDIR)$(DOCPREFIX)/ii
|
|
|
|
install -m 775 ii $(DESTDIR)$(PREFIX)/bin
|
|
|
|
sed "s/VERSION/$(VERSION)/g" < ii.1 > $(DESTDIR)$(MANPREFIX)/man1/ii.1
|
|
|
|
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/ii.1
|
2005-12-19 16:39:54 +03:00
|
|
|
|
|
|
|
uninstall: all
|
2018-05-29 19:27:36 +03:00
|
|
|
rm -f $(DESTDIR)$(MANPREFIX)/man1/ii.1 $(DESTDIR)$(PREFIX)/bin/ii
|
|
|
|
rm -rf $(DESTDIR)$(DOCPREFIX)/ii
|
2017-06-02 10:54:54 +03:00
|
|
|
|
|
|
|
dist: clean
|
2018-05-29 19:27:36 +03:00
|
|
|
mkdir -p ii-$(VERSION)
|
2017-06-02 10:54:54 +03:00
|
|
|
cp -R Makefile CHANGES README FAQ LICENSE strlcpy.c arg.h \
|
2018-05-29 19:27:36 +03:00
|
|
|
config.mk ii.c ii.1 ii-$(VERSION)
|
|
|
|
tar -cf ii-$(VERSION).tar ii-$(VERSION)
|
|
|
|
gzip ii-$(VERSION).tar
|
|
|
|
rm -rf ii-$(VERSION)
|
2005-12-19 16:39:54 +03:00
|
|
|
|
|
|
|
clean:
|
2017-06-02 10:54:54 +03:00
|
|
|
rm -f ii *.o
|