summaryrefslogtreecommitdiff
path: root/progs/Makefile
blob: ef51dc660b1a9a5c45c84c0b5f3284b051c07a5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

topdir=$(shell pwd)/..
include $(topdir)/Make.Rules
#
# Programs: all of the examples that we will compile
#
PROGS=getpcaps capsh
ifeq ($(LIBATTR),yes)
PROGS += getcap setcap
endif

BUILD=$(PROGS)

ifneq ($(DYNAMIC),yes)
LDFLAGS += --static
endif
LDLIBS += -L../libcap -lcap

all: $(BUILD)

$(BUILD): %: %.o
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)

%.o: %.c $(INCS)
	$(CC) $(IPATH) $(CFLAGS) -c $< -o $@

install: all
	mkdir -p -m 0755 $(SBINDIR)
	for p in $(PROGS) ; do \
		install -m 0755 $$p $(SBINDIR) ; \
	done
ifeq ($(RAISE_SETFCAP),yes)
	$(SBINDIR)/setcap cap_setfcap=i $(SBINDIR)/setcap
endif

clean:
	$(LOCALCLEAN)
	rm -f *.o $(BUILD) tcapsh ping hack.sh