You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ii/Makefile

61 lines
1.3 KiB

.POSIX:
5 years ago
VERSION = 2.0
5 years ago
# paths
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
DOCPREFIX = $(PREFIX)/share/doc
5 years ago
SRC = ii.c
OBJ = $(SRC:.c=.o)
# use system flags.
II_CFLAGS = $(CFLAGS)
II_LDFLAGS = $(LDFLAGS)
# on systems which provide strlcpy(3),
# remove NEED_STRLCPY from CPPFLAGS and
# remove strlcpy.o from LIBS
II_CPPFLAGS = $(CPPFLAGS) -DVERSION=\"$(VERSION)\" -D_DEFAULT_SOURCE -DNEED_STRLCPY
LIBS = strlcpy.o
all: ii
5 years ago
options:
@echo ii build options:
@echo "CFLAGS = $(CFLAGS)"
@echo "LDFLAGS = $(LDFLAGS)"
@echo "CC = $(CC)"
5 years ago
.c.o:
$(CC) -c $< $(II_CFLAGS) $(II_CPPFLAGS)
5 years ago
ii: $(OBJ) $(LIBS)
$(CC) -o $@ $(OBJ) $(LIBS) $(II_LDFLAGS)
5 years ago
$(OBJ): arg.h
5 years ago
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
mkdir -p $(DESTDIR)$(DOCPREFIX)/ii
install -m 644 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
5 years ago
uninstall: all
rm -f $(DESTDIR)$(MANPREFIX)/man1/ii.1 $(DESTDIR)$(PREFIX)/bin/ii
rm -rf $(DESTDIR)$(DOCPREFIX)/ii
dist: clean
mkdir -p ii-$(VERSION)
cp -R Makefile README FAQ LICENSE strlcpy.c arg.h \
ii.c ii.1 ii-$(VERSION)
tar -cf - ii-$(VERSION) | gzip -c > ii-$(VERSION).tar.gz
rm -rf ii-$(VERSION)
5 years ago
clean:
rm -f ii *.o