2014-10-04 11:34:51 -04:00
|
|
|
include ../build-aux/platform.mak
|
|
|
|
include ../build-aux/compiler.mak
|
|
|
|
include ../build-aux/version.mak
|
|
|
|
include ../build-aux/dirs.mak
|
|
|
|
|
|
|
|
OPTLEVEL?=$(DEFAULT_OPTLEVEL)
|
2016-02-28 16:14:17 -05:00
|
|
|
CFLAGS?=$(OPTLEVEL)
|
2014-10-04 11:34:51 -04:00
|
|
|
|
2016-02-28 16:14:17 -05:00
|
|
|
CFLAGS:=$(CFLAGS) -Wall -Wextra
|
2014-10-04 11:34:51 -04:00
|
|
|
|
|
|
|
BINARY=init
|
|
|
|
|
|
|
|
OBJS=\
|
|
|
|
init.o \
|
|
|
|
|
|
|
|
all: $(BINARY)
|
|
|
|
|
|
|
|
.PHONY: all install clean
|
|
|
|
|
|
|
|
$(BINARY): $(OBJS)
|
2016-02-28 16:14:17 -05:00
|
|
|
$(CC) $(CFLAGS) $(OBJS) -o $(BINARY) -lmount $(LIBS)
|
2014-10-04 11:34:51 -04:00
|
|
|
|
2016-02-28 16:14:17 -05:00
|
|
|
%.o: %.c
|
|
|
|
$(CC) -std=gnu11 $(CFLAGS) $(CPPFLAGS) -c $< -o $@
|
2014-10-04 11:34:51 -04:00
|
|
|
|
|
|
|
install: all
|
2015-07-23 20:24:49 -04:00
|
|
|
mkdir -p $(DESTDIR)$(SBINDIR)
|
|
|
|
install $(BINARY) $(DESTDIR)$(SBINDIR)
|
|
|
|
mkdir -p $(DESTDIR)$(MANDIR)/man8
|
|
|
|
cp init.8 $(DESTDIR)$(MANDIR)/man8/init.8
|
2014-10-04 11:34:51 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(BINARY) $(OBJS) *.o
|