2014-06-28 10:10:20 -04:00
|
|
|
include ../build-aux/platform.mak
|
|
|
|
include ../build-aux/compiler.mak
|
|
|
|
include ../build-aux/version.mak
|
|
|
|
include ../build-aux/dirs.mak
|
2013-03-19 18:28:32 -04:00
|
|
|
|
2014-04-13 16:34:36 -04:00
|
|
|
OPTLEVEL?=$(DEFAULT_OPTLEVEL)
|
2016-02-28 17:03:16 -05:00
|
|
|
CFLAGS?=$(OPTLEVEL)
|
2013-03-19 18:28:32 -04:00
|
|
|
|
2013-12-19 19:24:47 -05:00
|
|
|
SORTIXKERNEL=../kernel
|
2012-03-23 14:36:51 -04:00
|
|
|
|
2014-04-23 08:46:09 -04:00
|
|
|
CPPFLAGS:=$(CPPFLAGS) -DVERSIONSTR=\"$(VERSION)\" -I$(SORTIXKERNEL)/include -I.
|
2016-02-28 17:03:16 -05:00
|
|
|
CFLAGS:=$(CFLAGS) -Wall -Wextra
|
|
|
|
|
|
|
|
ifeq ($(HOST_IS_SORTIX),0)
|
|
|
|
CPPFLAGS+=-D_GNU_SOURCE
|
|
|
|
endif
|
2011-08-27 08:50:52 -04:00
|
|
|
|
2012-03-23 14:36:51 -04:00
|
|
|
BINARIES=mkinitrd initrdfs
|
2011-08-27 08:50:52 -04:00
|
|
|
|
|
|
|
all: $(BINARIES)
|
|
|
|
|
2014-04-22 09:26:55 -04:00
|
|
|
.PHONY: all install clean
|
2013-03-19 18:28:32 -04:00
|
|
|
|
2016-04-10 09:19:12 -04:00
|
|
|
%: %.c rules.c serialize.c
|
|
|
|
$(CC) -std=gnu11 $(CFLAGS) $(CPPFLAGS) $< rules.c serialize.c -o $@
|
2011-08-27 08:50:52 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(BINARIES)
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
install: all
|
2015-10-07 15:24:39 -04:00
|
|
|
mkdir -p $(DESTDIR)$(SBINDIR)
|
|
|
|
install $(BINARIES) $(DESTDIR)$(SBINDIR)
|
|
|
|
mkdir -p $(DESTDIR)$(MANDIR)/man8
|
|
|
|
cp initrdfs.8 $(DESTDIR)$(MANDIR)/man8/initrdfs.8
|
|
|
|
cp mkinitrd.8 $(DESTDIR)$(MANDIR)/man8/mkinitrd.8
|