openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

Makefile (1187B)


      1 # -*- Makefile -*-
      2 # 
      3 # This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4 # 
      5 # Copyright 2007-2019 Broadcom Inc. All rights reserved.
      6 #
      7 LOCALDIR = systems/linux/kernel/modules/uk-proxy
      8 
      9 include ${SDK}/make/Make.config
     10 
     11 KERN_LIBS = $(LIBDIR)/libkern.a
     12 
     13 ifeq ($(kernel_version),2_4)
     14 MODULE = $(LIBDIR)/linux-uk-proxy.o
     15 else
     16 KERNEL_MODULE_DIR = kernel_module
     17 
     18 THIS_MOD_NAME := linux-uk-proxy
     19 MODULE = $(LIBDIR)/$(THIS_MOD_NAME).o
     20 KMODULE = $(LIBDIR)/$(THIS_MOD_NAME).ko
     21 
     22 build: $(MODULE) $(KMODULE)
     23 endif
     24 
     25 $(MODULE): $(BLDDIR)/.tree $(BOBJS) $(KERN_LIBS)
     26 	$(LD) $(MODULE_LDFLAGS) -r $(BOBJS) $(KERN_LIBS) -o $@
     27 ifneq ($(kernel_version),2_4)
     28 $(KMODULE): $(MODULE)
     29 	rm -fr $(BLDDIR)/$(KERNEL_MODULE_DIR)
     30 	mkdir $(BLDDIR)/$(KERNEL_MODULE_DIR)
     31 	cp ${SDK}/make/Makefile.linux-kmodule $(BLDDIR)/$(KERNEL_MODULE_DIR)/Makefile
     32 	MOD_NAME=$(THIS_MOD_NAME) $(MAKE) -C $(BLDDIR)/$(KERNEL_MODULE_DIR) $(THIS_MOD_NAME).ko
     33 endif
     34 
     35 include ${SDK}/make/Make.depend
     36 
     37 # Make.depend is before clean:: so that Make.depend's clean:: runs first.
     38 
     39 clean::
     40 	$(RM) $(BOBJS) $(MODULE)
     41 
     42 ifneq ($(kernel_version),2_4)
     43 .PHONY: build
     44 endif