2013-03-19 18:28:32 -04:00
|
|
|
include ../compiler.mak
|
|
|
|
include ../version.mak
|
|
|
|
include ../dirs.mak
|
|
|
|
|
|
|
|
ifndef OPTLEVEL
|
|
|
|
OPTLEVEL=-g -O2
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef CXXFLAGS
|
|
|
|
CXXFLAGS:=$(OPTLEVEL)
|
|
|
|
endif
|
|
|
|
|
2012-03-23 14:36:51 -04:00
|
|
|
SORTIXKERNEL=../sortix
|
2012-09-28 18:53:50 -04:00
|
|
|
LIBC=../libc
|
2012-03-23 14:36:51 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
CPPFLAGS:=$(CPPFLAGS) -I$(SORTIXKERNEL)/include
|
|
|
|
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
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
INSTALLBINARIES:=$(addprefix $(DESTDIR)$(BINDIR)/,$(BINARIES))
|
|
|
|
|
2011-08-27 08:50:52 -04:00
|
|
|
all: $(BINARIES)
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
.PHONY: all install uninstall clean
|
|
|
|
|
2013-01-29 14:01:46 -05:00
|
|
|
%: %.cpp crc32.cpp rules.cpp $(LIBC)/ioleast.cpp
|
2013-03-19 18:28:32 -04:00
|
|
|
$(CXX) -std=gnu++11 $(CPPFLAGS) $(CXXFLAGS) $< crc32.cpp rules.cpp $(LIBC)/ioleast.cpp -o $@
|
2011-08-27 08:50:52 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(BINARIES)
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
install: all
|
|
|
|
mkdir -p $(DESTDIR)$(BINDIR)
|
|
|
|
install $(BINARIES) $(DESTDIR)$(BINDIR)
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f $(INSTALLBINARIES)
|
2012-03-21 19:52:29 -04:00
|
|
|
|