40 lines
759 B
Makefile
40 lines
759 B
Makefile
|
|
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
|
|
|
|
CC:=$(DIET) $(CC)
|
|
|
|
.PHONY: all install clean
|
|
all: execwrap
|
|
|
|
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
|