Home | History | Annotate | Download | only in progs
      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 getcap setcap
      8 
      9 BUILD=$(PROGS)
     10 
     11 ifneq ($(DYNAMIC),yes)
     12 LDFLAGS += --static
     13 endif
     14 LDLIBS += -L../libcap -lcap
     15 
     16 all: $(BUILD)
     17 
     18 $(BUILD): %: %.o
     19 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
     20 
     21 %.o: %.c $(INCS)
     22 	$(CC) $(IPATH) $(CFLAGS) -c $< -o $@
     23 
     24 install: all
     25 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
     26 	for p in $(PROGS) ; do \
     27 		install -m 0755 $$p $(FAKEROOT)$(SBINDIR) ; \
     28 	done
     29 ifeq ($(RAISE_SETFCAP),yes)
     30 	$(FAKEROOT)$(SBINDIR)/setcap cap_setfcap=i $(FAKEROOT)$(SBINDIR)/setcap
     31 endif
     32 
     33 clean:
     34 	$(LOCALCLEAN)
     35 	rm -f *.o $(BUILD) tcapsh ping hack.sh
     36