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
|
|
|
|
|
2013-12-19 19:24:47 -05:00
|
|
|
SORTIXKERNEL=../kernel
|
2012-03-23 14:36:51 -04:00
|
|
|
|
2013-09-25 17:40:27 -04:00
|
|
|
CPPFLAGS:=$(CPPFLAGS) -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
|
|
|
|
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-09-25 17:40:27 -04:00
|
|
|
%: %.cpp crc32.cpp rules.cpp
|
|
|
|
$(CXX) -std=gnu++11 $(CPPFLAGS) $(CXXFLAGS) $< crc32.cpp rules.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
|
|
|
|