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
|
|
|
|
|
2014-04-13 16:34:36 -04:00
|
|
|
OPTLEVEL?=$(DEFAULT_OPTLEVEL)
|
|
|
|
CXXFLAGS?=$(OPTLEVEL)
|
2012-12-15 20:11:18 -05:00
|
|
|
|
|
|
|
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)
|
2014-04-13 16:34:36 -04:00
|
|
|
$(AR) rcs $@ $(CLIENT_OBJS)
|
2012-12-15 20:11:18 -05:00
|
|
|
|
|
|
|
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
|
2014-04-13 16:34:36 -04:00
|
|
|
$(CXX) -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)
|