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)
|
|
|
|
CXXFLAGS?=$(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.
|
2013-03-19 18:28:32 -04:00
|
|
|
CXXFLAGS:=$(CXXFLAGS) -Wall -Wextra -fno-exceptions -fno-rtti
|
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
|
|
|
|
2015-01-19 10:27:52 -05:00
|
|
|
%: %.cpp crc32.cpp rules.cpp serialize.cpp
|
|
|
|
$(CXX) -std=gnu++11 $(CPPFLAGS) $(CXXFLAGS) $< crc32.cpp rules.cpp serialize.cpp -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
|