diff options
Diffstat (limited to 'progs/Makefile')
-rw-r--r-- | progs/Makefile | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/progs/Makefile b/progs/Makefile index 1d7fc7a..2c3c993 100644 --- a/progs/Makefile +++ b/progs/Makefile @@ -4,17 +4,17 @@ include $(topdir)/Make.Rules # # Programs: all of the examples that we will compile # -PROGS=getpcaps capsh getcap setcap +PROGS=getpcaps getcap setcap BUILD=$(PROGS) -all: $(BUILD) +all: $(BUILD) capsh ifeq ($(DYNAMIC),yes) LDPATH = LD_LIBRARY_PATH=../libcap DEPS = ../libcap/libcap.so else -LDFLAGS += --static +LDSTATIC = --static DEPS = ../libcap/libcap.a endif @@ -25,28 +25,40 @@ endif make -C ../libcap libcap.so $(BUILD): %: %.o $(DEPS) - $(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS) + $(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDSTATIC) %.o: %.c $(INCS) - $(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -c $< -o $@ + $(CC) $(IPATH) $(CFLAGS) -c $< -o $@ install: all mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR) - for p in $(PROGS) ; do \ + for p in $(PROGS) capsh ; do \ install -m 0755 $$p $(FAKEROOT)$(SBINDIR) ; \ done ifeq ($(RAISE_SETFCAP),yes) $(FAKEROOT)$(SBINDIR)/setcap cap_setfcap=i $(FAKEROOT)$(SBINDIR)/setcap endif -test: $(PROGS) +test: $(PROGS) capsh -tcapsh-static: capsh.c $(DEPS) - $(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS) --static +capshdoc.h.cf: capshdoc.h ./mkcapshdoc.sh + ./mkcapshdoc.sh > $@ + diff -u capshdoc.h $@ || (rm $@ ; exit 1) -sudotest: test tcapsh-static +capsh: capsh.c capshdoc.h.cf $(DEPS) + $(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDSTATIC) + +tcapsh-static: capsh.c capshdoc.h.cf $(DEPS) + $(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -o $@ $< $(LIBCAPLIB) --static + +uns_test: ../tests/uns_test.c + $(MAKE) -C ../tests uns_test + cp ../tests/uns_test . + +sudotest: test tcapsh-static uns_test sudo $(LDPATH) ./quicktest.sh clean: $(LOCALCLEAN) - rm -f *.o $(BUILD) tcapsh* privileged ping hack.sh compare-cap + rm -f *.o $(BUILD) privileged ping hack.sh compare-cap uns_test + rm -f capsh tcapsh* capshdoc.h.cf |