aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 22 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 357c19a..7269dcf 100644
--- a/Makefile
+++ b/Makefile
@@ -4,16 +4,27 @@ endif
include $(DPP_ROOT)/Makefile.inc
+SOCKET_HEADERS = ksocket/berkeley.h ksocket/helper.hpp ksocket/ksocket.h ksocket/wsk.h
+SOCKET_OBJECTS = ksocket/ksocket.o ksocket/berkeley.o
+
+PROTOB_HEADERS = protobuf-c/protobuf-c.h
+PROTOB_OBJECTS = protobuf-c/protobuf-c.o
+
+CRYPTO_HEADERS =
+CRYPTO_OBJECTS = crypto/aes.o crypto/hmac.o crypto/sha1.o crypto/pkcs7_padding.o
+
+STATIC_LIB_OBJS = $(SOCKET_OBJECTS) $(PROTOB_OBJECTS) $(CRYPTO_OBJECTS)
+
DRIVER0_NAME = driver
-DRIVER0_OBJECTS = examples/$(DRIVER0_NAME).o ksocket/ksocket.o ksocket/berkeley.o
+DRIVER0_OBJECTS = examples/$(DRIVER0_NAME).o $(SOCKET_OBJECTS)
DRIVER0_TARGET = $(DRIVER0_NAME).sys
DRIVER1_NAME = driver-protobuf-c
-DRIVER1_OBJECTS = examples/$(DRIVER1_NAME).o protobuf-c/protobuf-c.o examples/example.pb-c.o
+DRIVER1_OBJECTS = examples/$(DRIVER1_NAME).o $(PROTOB_OBJECTS) examples/example.pb-c.o
DRIVER1_TARGET = $(DRIVER1_NAME).sys
DRIVER2_NAME = driver-protobuf-c-tcp
-DRIVER2_OBJECTS = examples/$(DRIVER2_NAME).o ksocket/ksocket.o ksocket/berkeley.o protobuf-c/protobuf-c.o examples/example.pb-c.o
+DRIVER2_OBJECTS = examples/$(DRIVER2_NAME).o $(SOCKET_OBJECTS) $(PROTOB_OBJECTS) examples/example.pb-c.o
DRIVER2_TARGET = $(DRIVER2_NAME).sys
USERSPACE0_NAME = userspace_client
@@ -21,7 +32,7 @@ USERSPACE0_OBJECTS = examples/$(USERSPACE0_NAME).o
USERSPACE0_TARGET = $(USERSPACE0_NAME).exe
USERSPACE1_NAME = userspace_client_protobuf
-USERSPACE1_OBJECTS = examples/$(USERSPACE1_NAME).o protobuf-c/protobuf-c.o examples/example.pb-c.o
+USERSPACE1_OBJECTS = examples/$(USERSPACE1_NAME).o $(PROTOB_OBJECTS) examples/example.pb-c.o
USERSPACE1_TARGET = $(USERSPACE1_NAME).exe
# mingw-w64-dpp related
@@ -71,7 +82,13 @@ install: $(DRIVER0_TARGET) $(DRIVER1_TARGET) $(DRIVER2_TARGET) $(USERSPACE0_TARG
$(INSTALL) 'examples/$(DRIVER1_NAME).bat' '$(DESTDIR)/'
$(INSTALL) 'examples/$(DRIVER2_NAME).bat' '$(DESTDIR)/'
+package: $(SOCKET_HEADERS) $(PROTOB_HEADERS) $(STATIC_LIB_OBJS)
+ $(call INSTALL_HEADERS,ksocket,$(SOCKET_HEADERS),package)
+ $(call INSTALL_HEADERS,protobuf-c,$(PROTOB_HEADERS),package)
+ $(call PACKAGE,ksocket,$(STATIC_LIB_OBJS),package)
+
clean:
+ rm -f $(STATIC_LIB_OBJS)
rm -f $(DRIVER0_OBJECTS) $(DRIVER1_OBJECTS) $(DRIVER2_OBJECTS)
rm -f $(DRIVER0_TARGET) $(DRIVER0_TARGET).map \
$(DRIVER1_TARGET) $(DRIVER1_TARGET).map \
@@ -80,5 +97,5 @@ clean:
rm -f $(USERSPACE0_TARGET) $(USERSPACE1_TARGET)
.NOTPARALLEL: clean
-.PHONY: all install clean
+.PHONY: all install package clean
.DEFAULT_GOAL := all