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