summaryrefslogtreecommitdiffstats
path: root/src/VBox/NetworkServices/Dhcpd/Makefile.kmk
blob: 48e51ffaaa105f7c7ee67ab4e75b9b64813d6de6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# $Id: Makefile.kmk $
## @file
# Sub-makefile for the DHCP server
#

#
# Copyright (C) 2006-2019 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#

SUB_DEPTH = ../../../..
include $(KBUILD_PATH)/subheader.kmk
# ifdef VBOX_WITH_...

 VBOX_PATH_Dhcpd_SRC := $(PATH_SUB_CURRENT)

 # XXX: do not depend on order
 ifndef LWIP_SOURCES
  include $(PATH_SUB_CURRENT)/../../Devices/Network/lwip-new/Config.kmk
 endif

 ifdef VBOX_WITH_HARDENING
  PROGRAMS += VBoxNetDhcpdHardened
  DLLS += VBoxNetDhcpd
 else
  PROGRAMS += VBoxNetDhcpd
 endif

 VBoxNetDhcpdHardened_TEMPLATE = VBOXR3HARDENEDEXE
 VBoxNetDhcpdHardened_NAME     = VBoxNetDHCP
 VBoxNetDhcpdHardened_DEFS     = SERVICE_NAME=\"VBoxNetDhcpd\"
 VBoxNetDhcpdHardened_SOURCES  = VBoxNetDhcpdHardened.cpp
 VBoxNetDhcpdHardened_SOURCES.win = $(VBoxNetDhcpd_0_OUTDIR)/VBoxNetDhcpd-icon.rc
 VBoxNetDhcpdHardened_LDFLAGS.win = /SUBSYSTEM:windows

 VBoxNetDhcpd_TEMPLATE := $(if-expr defined(VBOX_WITH_HARDENING),VBoxR3Dll,VBOXR3EXE)
 VBoxNetDhcpd_NAME      = VBoxNetDHCP
 # VBoxNetDhcpd_DEFS      = IPv6
 # VBoxNetDhcpd_DEFS.linux = WITH_VALGRIND
 #VBoxNetDhcpd_DEFS.win  = VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x501 # Windows XP

 # (current dir is for for lwipopts.h)
 VBoxNetDhcpd_INCS += . $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_INCS))

 VBoxNetDhcpd_DEFS    = KBUILD_TYPE=\"$(KBUILD_TYPE)\"
 ifneq ($(KBUILD_TARGET),win)
  VBoxNetDhcpd_DEFS     += VBOX_WITH_XPCOM
  VBoxNetDhcpd_INCS     += $(VBOX_XPCOM_INCS)
  ifneq ($(KBUILD_TARGET),darwin)
   # We want -std=c++11 for 4.7 and newer compilers, and -std=c++0x for older ones.
   VBoxNetDhcpd_CXXFLAGS += -std=$(if $(VBOX_GCC_VERSION_CXX),$(if $(VBOX_GCC_VERSION_CXX) < 40700,c++0x,c++11),c++0x)
  endif
 endif
 VBoxNetDhcpd_SOURCES = ../../Main/glue/VBoxLogRelCreate.cpp \
                        ../../Main/glue/GetVBoxUserHomeDirectory.cpp \
                        ClientId.cpp \
                        Config.cpp \
                        DHCPD.cpp \
                        Db.cpp \
                        DhcpMessage.cpp \
                        DhcpOptions.cpp \
                        IPv4Pool.cpp \
                        TimeStamp.cpp \
                        VBoxNetDhcpd.cpp \
                        $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_SOURCES))

 VBoxNetDhcpd_LIBS = $(LIB_RUNTIME)

 VBoxNetDhcpd_LIBS.solaris += socket nsl
 VBoxNetDhcpd_LDFLAGS.win = /SUBSYSTEM:windows

 ifeq ($(KBUILD_TARGET),win)
  # Icon include file.
  VBoxNetDhcpd_SOURCES  += VBoxNetDhcpd.rc
  VBoxNetDhcpd.rc_INCS       = $(VBoxNetDhcpd_0_OUTDIR)
  VBoxNetDhcpd.rc_DEPS       = $(VBoxNetDhcpd_0_OUTDIR)/VBoxNetDhcpd-icon.rc
  VBoxNetDhcpd.rc_CLEAN      = $(VBoxNetDhcpd_0_OUTDIR)/VBoxNetDhcpd-icon.rc

  $$(VBoxNetDhcpd_0_OUTDIR)/VBoxNetDhcpd-icon.rc: $(VBOX_WINDOWS_ICON_FILE) \
						  $$(VBoxNetDhcpd_DEFPATH)/Makefile.kmk | $$(dir $$@)
	$(RM) -f $@
	$(APPEND) $@ 'IDI_VIRTUALBOX ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
 endif # win

# endif # VBOX_WITH_...
include $(FILE_KBUILD_SUB_FOOTER)