VirtualBox

Changeset 82745 in vbox


Ignore:
Timestamp:
Jan 14, 2020 8:38:09 PM (5 years ago)
Author:
vboxsync
Message:

VBoxNetDHCP: No need for custom RC file, use template and get version info in the hardened .exe too. Cleaned up the makefile, renaming the target to match the output.

Location:
trunk/src/VBox/NetworkServices/Dhcpd
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/Dhcpd/Makefile.kmk

    r79525 r82745  
    11# $Id$
    22## @file
    3 # Sub-makefile for the DHCP server
     3# Sub-makefile for the DHCP server.
    44#
    55
     
    1616#
    1717
    18 SUB_DEPTH = ../../../..
     18SUB_DEPTH := ../../../..
    1919include $(KBUILD_PATH)/subheader.kmk
    20 # ifdef VBOX_WITH_...
    2120
    22  VBOX_PATH_Dhcpd_SRC := $(PATH_SUB_CURRENT)
     21ifndef LWIP_SOURCES
     22 include $(PATH_SUB_CURRENT)/../../Devices/Network/lwip-new/Config.kmk
     23endif
    2324
    24  # XXX: do not depend on order
    25  ifndef LWIP_SOURCES
    26   include $(PATH_SUB_CURRENT)/../../Devices/Network/lwip-new/Config.kmk
     25#
     26# Hardended stub executable.
     27#
     28ifdef VBOX_WITH_HARDENING
     29PROGRAMS += VBoxNetDHCPHardened
     30VBoxNetDHCPHardened_TEMPLATE = VBOXR3HARDENEDEXE
     31VBoxNetDHCPHardened_NAME     = VBoxNetDHCP
     32VBoxNetDHCPHardened_SOURCES  = VBoxNetDhcpdHardened.cpp
     33VBoxNetDHCPHardened_LDFLAGS.win = /SUBSYSTEM:windows
     34$(call VBOX_SET_VER_INFO_DLL,VBoxNetDHCPHardened,VirtualBox DHCP Server,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
     35endif
     36
     37
     38#
     39# The DHCP server module (dll if hardended)
     40#
     41ifdef VBOX_WITH_HARDENING
     42DLLS     += VBoxNetDHCP
     43VBoxNetDHCP_TEMPLATE := VBoxR3Dll
     44else
     45PROGRAMS += VBoxNetDHCP
     46VBoxNetDHCP_TEMPLATE := VBOXR3EXE
     47endif
     48
     49# (current dir is for for lwipopts.h)
     50VBoxNetDHCP_INCS += . $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_INCS))
     51
     52VBoxNetDHCP_DEFS      = KBUILD_TYPE=\"$(KBUILD_TYPE)\"
     53#VBoxNetDHCP_DEFS     = IPv6
     54#VBoxNetDHCP_DEFS.linux = WITH_VALGRIND
     55ifneq ($(KBUILD_TARGET),win)
     56VBoxNetDHCP_DEFS     += VBOX_WITH_XPCOM
     57VBoxNetDHCP_INCS     += $(VBOX_XPCOM_INCS)
     58 ifneq ($(KBUILD_TARGET),darwin)
     59  # We want -std=c++11 for 4.7 and newer compilers, and -std=c++0x for older ones.
     60VBoxNetDHCP_CXXFLAGS += -std=$(if $(VBOX_GCC_VERSION_CXX),$(if $(VBOX_GCC_VERSION_CXX) < 40700,c++0x,c++11),c++0x)
    2761 endif
    28 
    29  ifdef VBOX_WITH_HARDENING
    30   PROGRAMS += VBoxNetDhcpdHardened
    31   DLLS += VBoxNetDhcpd
    32  else
    33   PROGRAMS += VBoxNetDhcpd
    34  endif
    35 
    36  VBoxNetDhcpdHardened_TEMPLATE = VBOXR3HARDENEDEXE
    37  VBoxNetDhcpdHardened_NAME     = VBoxNetDHCP
    38  VBoxNetDhcpdHardened_DEFS     = SERVICE_NAME=\"VBoxNetDhcpd\"
    39  VBoxNetDhcpdHardened_SOURCES  = VBoxNetDhcpdHardened.cpp
    40  VBoxNetDhcpdHardened_SOURCES.win = $(VBoxNetDhcpd_0_OUTDIR)/VBoxNetDhcpd-icon.rc
    41  VBoxNetDhcpdHardened_LDFLAGS.win = /SUBSYSTEM:windows
    42 
    43  VBoxNetDhcpd_TEMPLATE := $(if-expr defined(VBOX_WITH_HARDENING),VBoxR3Dll,VBOXR3EXE)
    44  VBoxNetDhcpd_NAME      = VBoxNetDHCP
    45  # VBoxNetDhcpd_DEFS      = IPv6
    46  # VBoxNetDhcpd_DEFS.linux = WITH_VALGRIND
    47  #VBoxNetDhcpd_DEFS.win  = VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x501 # Windows XP
    48 
    49  # (current dir is for for lwipopts.h)
    50  VBoxNetDhcpd_INCS += . $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_INCS))
    51 
    52  VBoxNetDhcpd_DEFS       = KBUILD_TYPE=\"$(KBUILD_TYPE)\"
    53  ifneq ($(KBUILD_TARGET),win)
    54   VBoxNetDhcpd_DEFS     += VBOX_WITH_XPCOM
    55   VBoxNetDhcpd_INCS     += $(VBOX_XPCOM_INCS)
    56   ifneq ($(KBUILD_TARGET),darwin)
    57    # We want -std=c++11 for 4.7 and newer compilers, and -std=c++0x for older ones.
    58    VBoxNetDhcpd_CXXFLAGS += -std=$(if $(VBOX_GCC_VERSION_CXX),$(if $(VBOX_GCC_VERSION_CXX) < 40700,c++0x,c++11),c++0x)
    59   endif
    60  endif
    61  VBoxNetDhcpd_SOURCES = \
     62endif
     63VBoxNetDHCP_SOURCES = \
    6264        ClientId.cpp \
    6365        Config.cpp \
     
    6971        Timestamp.cpp \
    7072        VBoxNetDhcpd.cpp \
    71         ../../Main/glue/VBoxLogRelCreate.cpp \
     73        ../../Main/glue/VBoxLogRelCreate.cpp \
    7274        ../../Main/glue/GetVBoxUserHomeDirectory.cpp \
    7375        $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_SOURCES))
    7476
    75  VBoxNetDhcpd_LIBS = $(LIB_RUNTIME)
    76  VBoxNetDhcpd_LIBS.solaris += socket nsl
    77  VBoxNetDhcpd_LDFLAGS.win = /SUBSYSTEM:windows
     77VBoxNetDHCP_LIBS = $(LIB_RUNTIME)
     78VBoxNetDHCP_LIBS.solaris += socket nsl
     79VBoxNetDHCP_LDFLAGS.win = /SUBSYSTEM:windows
    7880
    79  ifeq ($(KBUILD_TARGET),win)
    80   # Icon include file.
    81   VBoxNetDhcpd_SOURCES  += VBoxNetDhcpd.rc
    82   VBoxNetDhcpd.rc_INCS       = $(VBoxNetDhcpd_0_OUTDIR)
    83   VBoxNetDhcpd.rc_DEPS       = $(VBoxNetDhcpd_0_OUTDIR)/VBoxNetDhcpd-icon.rc
    84   VBoxNetDhcpd.rc_CLEAN      = $(VBoxNetDhcpd_0_OUTDIR)/VBoxNetDhcpd-icon.rc
     81ifdef VBOX_WITH_HARDENING
     82 $(call VBOX_SET_VER_INFO_DLL,VBoxNetDHCP,VirtualBox DHCP Server (dll),$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
     83else
     84 $(call VBOX_SET_VER_INFO_EXE,VBoxNetDHCP,VirtualBox DHCP Server,$(VBOX_WINDOWS_ICON_FILE))       # Version info / description.
     85endif
    8586
    86   $$(VBoxNetDhcpd_0_OUTDIR)/VBoxNetDhcpd-icon.rc: $(VBOX_WINDOWS_ICON_FILE) \
    87                                                   $$(VBoxNetDhcpd_DEFPATH)/Makefile.kmk | $$(dir $$@)
    88         $(RM) -f $@
    89         $(APPEND) $@ 'IDI_VIRTUALBOX ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
    90  endif # win
     87include $(FILE_KBUILD_SUB_FOOTER)
    9188
    92 # endif # VBOX_WITH_...
    93 include $(FILE_KBUILD_SUB_FOOTER)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette