2013-03-19 18:28:32 -04:00
|
|
|
SOFTWARE_MEANT_FOR_SORTIX=1
|
2012-12-15 20:11:18 -05:00
|
|
|
include ../compiler.mak
|
|
|
|
include ../version.mak
|
|
|
|
include ../dirs.mak
|
|
|
|
|
|
|
|
ifndef OPTLEVEL
|
2013-03-19 18:28:32 -04:00
|
|
|
OPTLEVEL:=-g -O2
|
2012-12-15 20:11:18 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef CXXFLAGS
|
|
|
|
CXXFLAGS:=$(OPTLEVEL)
|
|
|
|
endif
|
|
|
|
|
|
|
|
CXXFLAGS:=$(CXXFLAGS) -Wall -Wextra -fno-exceptions -fno-rtti
|
|
|
|
CPPFLAGS:=$(CPPFLAGS) -I include
|
|
|
|
|
|
|
|
CLIENT_OBJS:=\
|
|
|
|
client/library.o \
|
|
|
|
client/session.o \
|
|
|
|
client/window.o \
|
|
|
|
|
|
|
|
SERVER_OBJS:=\
|
|
|
|
server/dispd.o \
|
|
|
|
|
|
|
|
BINS:=server/dispd client/libdispd.a
|
|
|
|
|
|
|
|
all: $(BINS)
|
|
|
|
|
|
|
|
.PHONY: all headers client server clean install install-include-dirs \
|
|
|
|
install-headers install-client-dirs install-client install-server-dirs \
|
|
|
|
install-server
|
|
|
|
|
|
|
|
headers:
|
|
|
|
|
|
|
|
client: client/libdispd.a
|
|
|
|
|
|
|
|
client/libdispd.a: $(CLIENT_OBJS)
|
|
|
|
$(HOSTAR) rcs $@ $(CLIENT_OBJS)
|
|
|
|
|
|
|
|
server: server/dispd
|
|
|
|
|
|
|
|
server/dispd: $(SERVER_OBJS)
|
|
|
|
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(SERVER_OBJS) -o $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(CLIENT_OBJS) $(SERVER_OBJS)
|
|
|
|
rm -f $(BINS)
|
|
|
|
rm -f *.o client/*.o server/*.o
|
|
|
|
|
|
|
|
%.o: %.cpp
|
2013-03-19 18:28:32 -04:00
|
|
|
$(HOSTCXX) -std=gnu++11 -c $< -o $@ $(CPPFLAGS) $(CXXFLAGS)
|
2012-12-15 20:11:18 -05:00
|
|
|
|
|
|
|
# Installation into sysroot
|
|
|
|
install: install-headers install-client install-server
|
|
|
|
|
|
|
|
install-include-dirs: headers
|
2013-03-19 18:28:32 -04:00
|
|
|
mkdir -p $(DESTDIR)$(INCLUDEDIR)
|
2012-12-15 20:11:18 -05:00
|
|
|
|
|
|
|
install-headers: install-include-dirs headers
|
2013-03-19 18:28:32 -04:00
|
|
|
cp -RTv include $(DESTDIR)$(INCLUDEDIR)
|
2012-12-15 20:11:18 -05:00
|
|
|
|
|
|
|
install-client-dirs:
|
2013-03-19 18:28:32 -04:00
|
|
|
mkdir -p $(DESTDIR)$(LIBDIR)
|
2012-12-15 20:11:18 -05:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
install-client: install-client-dirs client
|
|
|
|
cp -P client/libdispd.a $(DESTDIR)$(LIBDIR)
|
2012-12-15 20:11:18 -05:00
|
|
|
|
|
|
|
install-server-dirs:
|
2013-03-19 18:28:32 -04:00
|
|
|
mkdir -p $(DESTDIR)$(BINDIR)
|
2012-12-15 20:11:18 -05:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
install-server: install-server-dirs server
|
|
|
|
install server/dispd $(DESTDIR)$(BINDIR)
|