# Distributed under the terms of the GNU General Public License v2 # $Header: $ VERSION := 0.0.3 CC = gcc LIBS := -ldl DESTDIR = CFLAGS = -Wall -D_USE_SYSLOG_ENV #-fPIC #CFLAGS = -Wall TARGETS := libsfperms.so tst-fchmod tst-chmod default: $(TARGETS) all: default test libsfperms.so: $(CC) $(CFLAGS) -shared -fPIC -o libsfperms.so.$(VERSION) libsfperms.c -Wl,-soname=libsfperms.so $(LIBS) ln -s libsfperms.so.$(VERSION) libsfperms.so #$(CC) $(CFLAGS) -o tst-chmod tst-chmod.c $(LIBS) tst-chmod: tst-fchmod: $(CC) $(CFLAGS) -o $@ $@.c $(LIBS) clean: rm -f $(TARGETS) rm -f pipe *.so *.o distclean: clean rm -f *~ test: @echo -------------- fchmod test ------------------------ @./tst-fchmod @echo with sfperms @SFPERMS_SYSLOG=1 LD_PRELOAD=$$PWD/libsfperms.so.$(VERSION) ./tst-fchmod @echo --------------- chmod test ------------------------ @./tst-chmod @echo with sfperms @SFPERMS_SYSLOG=1 LD_PRELOAD=$$PWD/libsfperms.so.$(VERSION) ./tst-chmod @echo --------------------------------------------------- install: all cp libsfperms.so.$(VERSION) $(DESTDIR)/lib/ cd $(DESTDIR)/lib/ && ln -s libsfperms.so.$(VERSION) libsfperms.so