# Copyright (C) 2013-2015 Czech Technical University in Prague # # Authors: # - Michal Sojka # # 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, sublicense, 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 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 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # HOLDERS 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. # # File : Makefile.rules.posix # # This file contains variables and rules specific for compilation for # POSIX platform. makefile_rules_posix_dir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) ifeq ($(filter TARGET_CFLAGS,$(.VARIABLES)),) $(error "Makefile.config must be included before this file") endif CC=gcc AR=ar LD=$(CC) # Include definition of $(rpp_lib_INCLUDES) include $(makefile_rules_posix_dir)/../Makefile.var # Include UPPERCASE function include $(makefile_rules_dir)/../common.mk RPP_CFLAGS = $(rpp_lib_INCLUDES:%=-I$(makefile_rules_posix_dir)/../%) $(TARGET_CFLAGS) -DTARGET_$(call UPPERCASE,$(TARGET)) RPP_MAKE_CFLAGS = \ -MD -MF $@.dep -MP -MT $@ RPP_COMPILE_CMD = $(CC) -c $(RPP_CFLAGS) $(RPP_MAKE_CFLAGS) -o $@ $< RPP_PREPROC_CMD = $(CC) -E $(RPP_CFLAGS) -P -x c -o $@ $< BUILD_DIR ?= Debug RPP_LIB_DIR = $(makefile_rules_posix_dir)/$(TARGET)/$(BUILD_DIR) RPP_LDFLAGS = -L$(RPP_LIB_DIR) RPP_LDLIBS = -l:rpp-lib.lib $(TARGET_LDLIBS) -lpthread $(RPP_LIB_DIR)/rpp-lib.lib: $(MAKE) -C $(dir $@)