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

config.mk (2215B)


      1 # 
      2 # This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      3 # 
      4 # Copyright 2007-2019 Broadcom Inc. All rights reserved.
      5 #
      6 # PCIEG3 make rules and definitions
      7 #
      8 
      9 #
     10 # Provide reasonable defaults for configuration variables
     11 #
     12 
     13 # Default build directory
     14 ifndef PCIEG3_BLDDIR
     15 PCIEG3_BLDDIR = $(PCIEG3)/build
     16 endif
     17 
     18 # Location to build objects in
     19 ifndef PCIEG3_OBJDIR
     20 PCIEG3_OBJDIR = $(PCIEG3_BLDDIR)/obj
     21 endif
     22 override BLDDIR := $(PCIEG3_OBJDIR)
     23 
     24 # Location to place libraries
     25 ifndef PCIEG3_LIBDIR
     26 PCIEG3_LIBDIR = $(PCIEG3_BLDDIR)
     27 endif
     28 LIBDIR := $(PCIEG3_LIBDIR)
     29 
     30 # Option to retrieve compiler version
     31 ifndef PCIEG3_CC_VERFLAGS
     32 PCIEG3_CC_VERFLAGS := -v
     33 endif
     34 CC_VERFLAGS = $(PCIEG3_CC_VERFLAGS);
     35 
     36 # Default suffix for object files
     37 ifndef PCIEG3_OBJSUFFIX
     38 PCIEG3_OBJSUFFIX = o
     39 endif
     40 OBJSUFFIX = $(PCIEG3_OBJSUFFIX)
     41 
     42 # Default suffix for library files
     43 ifndef PCIEG3_LIBSUFFIX
     44 PCIEG3_LIBSUFFIX = a
     45 endif
     46 LIBSUFFIX = $(PCIEG3_LIBSUFFIX)
     47 
     48 #
     49 # Set up compiler options, etc.
     50 #
     51 
     52 # Default include path
     53 PCIEG3_INCLUDE_PATH = -I$(PCIEG3)/include
     54 PCIEG3_INCLUDE_PATH += -I$(PCIEG3)/merlin16/include
     55 INCDIR += $(PCIEG3_INCLUDE_PATH)
     56 # Import preprocessor flags avoiding include duplicates
     57 TMP_PCIEG3_CPPFLAGS := $(filter-out $(PCIEG3_INCLUDE_PATH),$(PCIEG3_CPPFLAGS))
     58 
     59 TMP_PCIEG3_CPPFLAGS += $(PCIEG3_DSYM_CPPFLAGS)
     60 export PCIEG3_DSYM_CPPFLAGS
     61 
     62 override CPPFLAGS = $(TMP_PCIEG3_CPPFLAGS) $(PCIEG3_INCLUDE_PATH)
     63 
     64 
     65 # Import compiler flags
     66 override CFLAGS = $(PCIEG3_CFLAGS)
     67 
     68 
     69 
     70 
     71 #
     72 # Define standard targets, etc.
     73 #
     74 
     75 ifdef LOCALDIR
     76 override BLDDIR := $(BLDDIR)/$(LOCALDIR)
     77 endif
     78 
     79 ifndef LSRCS
     80 LSRCS = $(wildcard *.c)
     81 endif
     82 ifndef LOBJS
     83 LOBJS = $(addsuffix .$(OBJSUFFIX), $(basename $(LSRCS)))
     84 endif
     85 ifndef BOBJS
     86 BOBJS = $(addprefix $(BLDDIR)/,$(LOBJS))
     87 endif
     88 
     89 # Use PCIEG3_QUIET=1 to control printing of compilation lines.
     90 ifdef PCIEG3_QUIET
     91 Q = @
     92 endif
     93 
     94 #
     95 # Define rules for creating object directories
     96 #
     97 #
     98 #	mkdir -p $(dir $@)
     99 .PRECIOUS: $(BLDDIR)/.tree
    100 
    101 %/.tree:
    102 	@$(ECHO) 'Creating build directory $(dir $@)'
    103 	$(Q)$(MKDIR) $(dir $@)
    104 	@$(ECHO) "Build Directory for $(LOCALDIR) created" > $@
    105 #
    106 # Configure build tools
    107 #
    108 include $(PCIEG3)/make/maketools.mk