# # Copyright 2004-2006 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # # Makefile for DTN2/applib # # Source files generated by rpcgen XDRSRCS := dtn_types_xdr.c # Sources for the client side of the library CLIENTLIB_SRCS := \ $(XDRSRCS) \ dtn_api.c \ dtn_ipc.c \ APIEndpointIDOpt.cc \ sdnv-c.c \ # Sources for the server side of the library SERVERLIB_SRCS := \ $(XDRSRCS) \ APIServer.cc \ dtn_ipc.c \ CLIENTLIB_OBJS := $(CLIENTLIB_SRCS:.c=.o) CLIENTLIB_OBJS := $(CLIENTLIB_OBJS:.cc=.o) CLIENTLIB_OBJS := $(CLIENTLIB_OBJS) ../dtn-version.o SERVERLIB_OBJS := $(SERVERLIB_SRCS:.c=.o) SERVERLIB_OBJS := $(SERVERLIB_OBJS:.cc=.o) ALLSRCS := $(CLIENTLIB_SRCS) $(SERVERLIB_SRCS) # # Default target is to build the two libraries # all: clientlib serverlib # # When dtn_types.x changes, we now manually rebuild dtn_types.h and # dtn_types_xdr.c # .PHONY: xdrs xdrs: -$(RM) -f dtn_types.h dtn_types_xdr.c rpcgen -h dtn_types.x -o dtn_types.h rpcgen -c dtn_types.x -o dtn_types_xdr.c clientlib: libdtnapi.a libdtnapi.a: $(CLIENTLIB_OBJS) rm -f $@ $(AR) ruc $@ $^ $(RANLIB) $@ || true serverlib: libdtnapisrv.a libdtnapisrv.a: $(SERVERLIB_OBJS) rm -f $@ $(AR) ruc $@ $^ $(RANLIB) $@ || true # # rpcgen emits code that has unused variables, so we can't use our # normally stringent warnings # %_xdr.o: %_xdr.c @rm -f $@; mkdir -p $(@D) $(CC) $(CPPFLAGS) $(DEBUG) $(OPTIMIZE) -c $< -o $@ # # Include the generated libraries in make clean # LIBFILES += libdtnapisrv.a libdtnapi.a # # Make sure SRCDIR is set (.. by default) # ifeq ($(SRCDIR),) SRCDIR := .. BUILDDIR := .. endif # # Include the common rules # include ../Rules.make