Makefile (946B)
1 PREFIX ?= /usr/local 2 3 all: libsfakeroot.so sfakeroot 4 5 CFLAGS=-Wall -Wextra -Werror -pedantic -std=c99 -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE -D_BSD_SOURCE -DSFAKEROOT_LIBDIR=\"$(DESTDIR)$(PREFIX)/lib\" 6 LDFLAGS=-L . 7 8 libsfakeroot.o: libsfakeroot.c 9 $(CC) -c -fPIC $(CFLAGS) -o $@ libsfakeroot.c 10 11 strlcpy.o: strlcpy.c 12 $(CC) -c -fPIC $(CFLAGS) -o $@ strlcpy.c 13 14 libsfakeroot.so: libsfakeroot.o strlcpy.o 15 $(CC) -fPIC $(CFLAGS) $(LDFLAGS) -shared -o $@ libsfakeroot.o strlcpy.o 16 17 sfakeroot: sfakeroot.o strlcpy.o 18 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ sfakeroot.o strlcpy.o -l sfakeroot 19 20 install: 21 install sfakeroot $(DESTDIR)$(PREFIX)/bin 22 install libsfakeroot.so $(DESTDIR)$(PREFIX)/lib 23 install *.1 $(DESTDIR)$(PREFIX)/man/man1/ 24 25 uninstall: 26 rm -f $(DESTDIR)$(PREFIX)/bin/sfakeroot 27 rm -f $(DESTDIR)$(PREFIX)/lib/libsfakeroot.so 28 rm -f $(DESTDIR)$(PREFIX)/man/man1/sfakeroot.1 29 30 clean: 31 rm -f *.o *.so sfakeroot 32 33 .PHONY: all clean install uninstall