execwrap/Makefile

43 lines
805 B
Makefile
Raw Normal View History

2009-10-23 08:35:28 +00:00
path = $(subst :, ,$(PATH))
diet_path = $(foreach dir,$(path),$(wildcard $(dir)/diet))
ifeq ($(strip $(diet_path)),)
ifneq ($(wildcard /opt/diet/bin/diet),)
DIET=/opt/diet/bin/diet
else
DIET=
endif
else
DIET:=$(strip $(diet_path))
endif
# to build without diet libc support, use $ make DIET=
# see http://www.fefe.de/dietlibc/ for details about the diet libc
ifneq ($(DEBUG),)
CFLAGS+=-g
LDFLAGS+=-g
else
CFLAGS+=-O2 -fomit-frame-pointer
LDFLAGS+=-s
ifneq ($(DIET),)
DIET+=-Os
endif
endif
2009-10-23 08:40:30 +00:00
# CC:=$(DIET) $(CC)
2009-10-23 08:35:28 +00:00
.PHONY: all install clean
all: execwrap
2009-10-23 08:40:30 +00:00
execwrap: execwrap.o
$(CC) -o $@ $< -lpam
2009-10-23 08:35:28 +00:00
install: execwrap
install -d $(DESTDIR)/usr/sbin/ $(DESTDIR)/usr/share/man/man8/
install -s -m 755 execwrap $(DESTDIR)/usr/sbin/
install execwrap.8 $(DESTDIR)/usr/share/man/man8/
clean:
rm -f execwrap