1 2 topdir=$(shell pwd)/.. 3 include $(topdir)/Make.Rules 4 # 5 # Programs: all of the examples that we will compile 6 # 7 PROGS=getpcaps capsh 8 ifeq ($(LIBATTR),yes) 9 PROGS += getcap setcap 10 endif 11 12 BUILD=$(PROGS) 13 14 ifneq ($(DYNAMIC),yes) 15 LDFLAGS += --static 16 endif 17 LDLIBS += -L../libcap -lcap 18 19 all: $(BUILD) 20 21 $(BUILD): %: %.o 22 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS) 23 24 %.o: %.c $(INCS) 25 $(CC) $(IPATH) $(CFLAGS) -c $< -o $@ 26 27 install: all 28 mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR) 29 for p in $(PROGS) ; do \ 30 install -m 0755 $$p $(FAKEROOT)$(SBINDIR) ; \ 31 done 32 ifeq ($(RAISE_SETFCAP),yes) 33 $(FAKEROOT)$(SBINDIR)/setcap cap_setfcap=i $(FAKEROOT)$(SBINDIR)/setcap 34 endif 35 36 clean: 37 $(LOCALCLEAN) 38 rm -f *.o $(BUILD) tcapsh ping hack.sh 39