Makefile 1.1 KB

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