+# Copyright (C) 2013-2015 Czech Technical University in Prague
+#
+# Authors:
+# - Michal Sojka <sojkam1@fel.cvut.cz>
+#
+# This document contains proprietary information belonging to Czech
+# Technical University in Prague. Passing on and copying of this
+# document, and communication of its contents is not permitted
+# without prior written authorization.
+#
+# 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 ($(TARGET_CFLAGS),)
+$(error "Makefile.config must be included before this file")
+endif
+
+include $(makefile_rules_posix_dir)/../common.mk
+
+CC=gcc
+AR=ar
+LD=$(CC)
+
+# Include definition of $(rpp_lib_INCLUDES)
+include $(makefile_rules_posix_dir)/../Makefile.var
+
+RPP_CFLAGS = -c $(rpp_lib_INCLUDES:%=-I$(makefile_rules_posix_dir)/../%) $(TARGET_CFLAGS)
+
+RPP_MAKE_CFLAGS = \
+ -MD -MF $@.dep -MP -MT $@
+
+define rpp_c_obj_cmds
+ $(call mkdir,$(dir $@))
+ $(CC) $(RPP_CFLAGS) $(RPP_MAKE_CFLAGS) -o $@ $<
+endef
+
+BUILD_DIR ?= Debug
+RPP_LIB_DIR = $(makefile_rules_posix_dir1)/$(TARGET)/$(BUILD_DIR)
+
+RPP_LDFLAGS =
+
+RPP_LDLIBS = -l$(RPP_LIB_DIR)/rpp-lib.lib $(TARGET_LDLIBS)
+
+$(RPP_LIB_DIR)/rpp-lib.lib:
+ $(MAKE) -C $(dir $@)