123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- ##############################################################################
- #
- # Copyright 2012 - 2021 Vivante Corporation, Santa Clara, California.
- # All Rights Reserved.
- #
- # Permission is hereby granted, free of charge, to any person obtaining
- # a copy of this software and associated documentation files (the
- # 'Software'), to deal in the Software without restriction, including
- # without limitation the rights to use, copy, modify, merge, publish,
- # distribute, sub license, and/or sell copies of the Software, and to
- # permit persons to whom the Software is furnished to do so, subject
- # to the following conditions:
- #
- # The above copyright notice and this permission notice (including the
- # next paragraph) shall be included in all copies or substantial
- # portions of the Software.
- #
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- # IN NO EVENT SHALL VIVANTE AND/OR ITS SUPPLIERS BE LIABLE FOR ANY
- # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- #
- ##############################################################################
- ################################################################################
- # Define a shortcut for the main target.
- TARGET_OUTPUT = $(OBJ_DIR)/$(TARGET_NAME)
- ifeq ($(TARGET_SONAME),)
- TARGET_SONAME := $(TARGET_NAME)
- endif
- ifeq ($(OBJ_DIR),)
- ifeq ($(DEBUG), 1)
- OBJ_DIR ?= bin_d
- else
- OBJ_DIR ?= bin_r
- endif
- endif
- ################################################################################
- # Specify targets.
- all: $(TARGET_OUTPUT)
- clean:
- @rm -rf $(OBJ_DIR)/* $(OBJ_DIR)
- @rm -rf $(CLEAN_EXTRA)
- install: $(TARGET_OUTPUT)
- ifneq ($(INSTALL_DIR),)
- @mkdir -p $(INSTALL_DIR)
- @-cp $(TARGET_OUTPUT) $(INSTALL_DIR)
- endif
- MAKEFILE_NAME = makefile.linux
- ifeq ($(gcdSTATIC_LINK),1)
- ifneq ($(USE_ARMCC), 1)
- PFLAGS += -static
- else
- PFLAGS += -L--no_search_dynamic_libraries
- endif
- else
- ifneq ($(QNX), 1)
- LIBS += -lrt
- endif
- PFLAGS += -Wl,-rpath-link $(VIVANTE_SDK_DIR)/drivers
- endif
- ifeq ($(PROGRAM), 1)
- $(TARGET_OUTPUT): $(OBJECTS)
- ifeq ($(SRC_CXX),)
- @echo " LINK \033[1m$(notdir $@)\033[0m"
- @$(CC) $(PFLAGS) $(OBJECTS) -o $(TARGET_OUTPUT) $(LIBS)
- else
- @echo " LINK \033[1m$(notdir $@)\033[0m"
- @$(CXX) $(PFLAGS) $(OBJECTS) -o $(TARGET_OUTPUT) $(LIBS)
- endif
- ifneq ($(USE_ARMCC), 1)
- ifneq ($(DEBUG), 1)
- @$(STRIP) $(TARGET_OUTPUT)
- endif
- endif
- endif
- ifeq ($(DYNAMIC), 1)
- ifeq ($(USE_ARMCC), 1)
- LDFLAGS += --shared -L--soname=,$(TARGET_NAME)
- else
- LDFLAGS += -Wall -shared -Wl,-soname,$(TARGET_NAME) -Wl,-z,defs
- endif
- $(TARGET_OUTPUT): $(OBJECTS)
- @echo " LINK \033[1m$(notdir $@)\033[0m"
- @$(CC) $(LDFLAGS) $(OBJECTS) -o $(TARGET_OUTPUT) $(LIBS)
- endif
- ifeq ($(STATIC), 1)
- $(TARGET_OUTPUT): $(OBJECTS)
- @echo " ARCHIVE \033[1m$(notdir $@)\033[0m"
- @$(AR) -r -c $(TARGET_OUTPUT) $(OBJECTS)
- ifneq ($(USE_ARMCC), 1)
- $(RANLIB) $(TARGET_OUTPUT)
- endif
- endif
- $(OBJ_DIR)/%.o: %.c
- @echo " COMPILE $(abspath $<)"
- @mkdir -p $(OBJ_DIR)
- @$(CC) -c $(CFLAGS) -o $@ $<
- $(OBJ_DIR)/%.o: %.cpp
- @echo " COMPILE $(abspath $<)"
- @mkdir -p $(OBJ_DIR)
- @$(CXX) -c $(CFLAGS) -o $@ $<
- $(OBJ_DIR)/%.o: %.cc
- @echo " COMPILE $(abspath $<)"
- @mkdir -p $(OBJ_DIR)
- @$(CXX) -c $(CFLAGS) -o $@ $<
|