apps/Makefile
changeset 0 2b3e5ec03512
child 1 44c5e3fa6d30
equal deleted inserted replaced
-1:000000000000 0:2b3e5ec03512
       
     1 #
       
     2 #    Copyright 2004-2006 Intel Corporation
       
     3 # 
       
     4 #    Licensed under the Apache License, Version 2.0 (the "License");
       
     5 #    you may not use this file except in compliance with the License.
       
     6 #    You may obtain a copy of the License at
       
     7 # 
       
     8 #        http://www.apache.org/licenses/LICENSE-2.0
       
     9 # 
       
    10 #    Unless required by applicable law or agreed to in writing, software
       
    11 #    distributed under the License is distributed on an "AS IS" BASIS,
       
    12 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    13 #    See the License for the specific language governing permissions and
       
    14 #    limitations under the License.
       
    15 #
       
    16 
       
    17 #
       
    18 # Makefile for DTN2/apps
       
    19 #
       
    20 
       
    21 ifeq ($(SRCDIR),)
       
    22 BUILDDIR := ..
       
    23 SRCDIR := ..
       
    24 endif
       
    25 
       
    26 SINGLE_SOURCE_APPS := 			\
       
    27 	dtncat/dtncat			\
       
    28 	dtncp/dtncp			\
       
    29 	dtncpd/dtncpd			\
       
    30 	dtnping/dtnping			\
       
    31 	dtnping/dtntraceroute		\
       
    32 	dtnping/dtnreporter		\
       
    33 	dtnperf/dtnperf-server		\
       
    34 	dtnrecv/dtnrecv			\
       
    35 	dtnsink/dtnsink			\
       
    36 	num2sdnv/num2sdnv		\
       
    37 
       
    38 OTHER_APPS :=				\
       
    39 	dtnmoteproxy/dtnmoteproxy	\
       
    40 	dtntest/dtntest			\
       
    41 	dtntunnel/dtntunnel		\
       
    42 	dtnperf/dtnperf-client		\
       
    43 	tca_admin/tca_admin		\
       
    44 	dtnsend/dtnsend			\
       
    45 	dtnsource/dtnsource		\
       
    46 	num2sdnv/sdnv2num		\
       
    47 
       
    48 APPS := $(SINGLE_SOURCE_APPS) $(OTHER_APPS)
       
    49 
       
    50 all: $(DTN_LIBS++) $(DTN_LIBS_STATIC) $(APPS) $(MANPAGES)
       
    51 include ../Rules.make
       
    52 include $(SRCDIR)/dtn-version.mk
       
    53 
       
    54 DTN_LIBS_STATIC := ../applib/libdtnapi.a ../applib/libdtnapi++.a
       
    55 DTN_LIBS := ../applib/libdtnapi.a $(OASYS_COMPAT_LDFLAGS)
       
    56 DTN_LIBS++ := $(DTN_LIBS) ../applib/libdtnapi++.a $(OASYS_LDFLAGS) $(EXTLIB_LDFLAGS)
       
    57 
       
    58 # Fake build target in case the api lib doesn't exist, but allows us
       
    59 # to include it as a dependency above so the apps get properly rebuilt
       
    60 # for the 'all' target
       
    61 $(DTN_LIBS_STATIC):
       
    62 	@echo "ERROR: $@ must be built before the apps can"
       
    63 	exit 1
       
    64 
       
    65 CFLAGS += -I$(SRCDIR)/applib
       
    66 CXXFLAGS += -I$(SRCDIR)/applib
       
    67 LDFLAGS += -L../applib
       
    68 
       
    69 BINFILES += $(APPS)
       
    70 
       
    71 #
       
    72 # For dtnmoteproxy, don't worry about cast alignment
       
    73 #
       
    74 dtnmoteproxy/dtnmoteproxy.o: dtnmoteproxy/dtnmoteproxy.c
       
    75 	@rm -f $@; mkdir -p $(@D)
       
    76 	$(CC) $(CPPFLAGS) -Wno-cast-align $(CFLAGS) -c $< -o $@
       
    77 
       
    78 dtnmoteproxy/serialsource.o: dtnmoteproxy/serialsource.c
       
    79 	@rm -f $@; mkdir -p $(@D)
       
    80 	$(CC) $(CPPFLAGS) -Wno-cast-align $(CFLAGS) -c $< -o $@
       
    81 
       
    82 dtnmoteproxy/dtnmoteproxy: dtnmoteproxy/dtnmoteproxy.o \
       
    83 			   dtnmoteproxy/serialsource.o
       
    84 	$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(DTN_LIBS)
       
    85 
       
    86 #
       
    87 # Rules for dtntest
       
    88 #
       
    89 dtntest/dtntest: dtntest/dtntest.o  $(DTN_LIBS_STATIC)
       
    90 	$(CXX) $(CXXFLAGS) $< -o $@ $(LDFLAGS) $(DTN_LIBS++)
       
    91 #
       
    92 # Rules for dtnsend
       
    93 #
       
    94 dtnsend/dtnsend: dtnsend/dtnsend.o  $(DTN_LIBS_STATIC)
       
    95 	$(CXX) $(CXXFLAGS) $< -o $@ $(LDFLAGS) $(DTN_LIBS++)
       
    96 
       
    97 #
       
    98 # Rules for dtnsource
       
    99 #
       
   100 dtnsource/dtnsource: dtnsource/dtnsource.o  $(DTN_LIBS_STATIC)
       
   101 	$(CXX) $(CXXFLAGS) $< -o $@ $(LDFLAGS) $(DTN_LIBS++)
       
   102 
       
   103 #
       
   104 # num2sdnv and sdnv2num are the same app
       
   105 #
       
   106 num2sdnv/sdnv2num: num2sdnv/num2sdnv
       
   107 	cp $< $@
       
   108 
       
   109 #
       
   110 # Rules for dtntunnel
       
   111 #
       
   112 dtntunnel/dtntunnel: dtntunnel/DTNTunnel.o \
       
   113 		     dtntunnel/TCPTunnel.o \
       
   114 		     dtntunnel/UDPTunnel.o \
       
   115 		     $(DTN_LIBS_STATIC)
       
   116 	$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(DTN_LIBS++)
       
   117 
       
   118 
       
   119 #
       
   120 # Rules for dtnperf-client
       
   121 #
       
   122 dtnperf/dtnperf-client: dtnperf/utils.o \
       
   123 			dtnperf/bundle_tools.o \
       
   124 			dtnperf/dtnperf-client.o \
       
   125 		    $(DTN_LIBS_STATIC)
       
   126 
       
   127 	$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(DTN_LIBS++)
       
   128 
       
   129 
       
   130 #
       
   131 # Rules for tca_admin
       
   132 #
       
   133 tca_admin/tca_admin: tca_admin/tca_admin.o \
       
   134                 tca_admin/TcaEndpointID.o \
       
   135                 ../servlib/routing/TcaControlBundle.o \
       
   136                 tca_admin/TcaRegistry.o \
       
   137                 tca_admin/TcaController.o \
       
   138                 tca_admin/libs/gateway_prot_clnt.o \
       
   139                 tca_admin/libs/gateway_prot_xdr.o \
       
   140                 tca_admin/libs/gateway_rpc.o \
       
   141                 tca_admin/libs/sha1.o \
       
   142 		$(DTN_LIBS_STATIC)
       
   143 	$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(DTN_LIBS++)
       
   144 
       
   145 #
       
   146 # Default rule for all single source apps
       
   147 #
       
   148 $(SINGLE_SOURCE_APPS): %: %.o $(DTN_LIBS_STATIC)
       
   149 	$(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) $(DTN_LIBS)