]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blob - build/Makefile.rules.posix
Generate list of GIO pin names
[pes-rpp/rpp-lib.git] / build / Makefile.rules.posix
1 # Copyright (C) 2013-2015 Czech Technical University in Prague
2 #
3 # Authors:
4 #     - Michal Sojka <sojkam1@fel.cvut.cz>
5 #
6 # This document contains proprietary information belonging to Czech
7 # Technical University in Prague. Passing on and copying of this
8 # document, and communication of its contents is not permitted
9 # without prior written authorization.
10 #
11 # File : Makefile.rules.posix
12 #
13 # This file contains variables and rules specific for compilation for
14 # POSIX platform.
15
16 makefile_rules_posix_dir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
17
18 ifeq ($(filter TARGET_CFLAGS,$(.VARIABLES)),)
19 $(error "Makefile.config must be included before this file")
20 endif
21
22 CC=gcc
23 AR=ar
24 LD=$(CC)
25
26 # Include definition of $(rpp_lib_INCLUDES)
27 include $(makefile_rules_posix_dir)/../Makefile.var
28
29 # Include UPPERCASE function
30 include $(makefile_rules_dir)/../common.mk
31
32 RPP_CFLAGS = $(rpp_lib_INCLUDES:%=-I$(makefile_rules_posix_dir)/../%) $(TARGET_CFLAGS) -DTARGET_$(call UPPERCASE,$(TARGET))
33
34 RPP_MAKE_CFLAGS = \
35                 -MD -MF $@.dep -MP -MT $@
36
37 RPP_COMPILE_CMD = $(CC) -c $(RPP_CFLAGS) $(RPP_MAKE_CFLAGS) -o $@ $<
38 RPP_PREPROC_CMD = $(CC) -E $(RPP_CFLAGS) -P -x c -o $@ $<
39
40 BUILD_DIR ?= Debug
41 RPP_LIB_DIR = $(makefile_rules_posix_dir)/$(TARGET)/$(BUILD_DIR)
42
43 RPP_LDFLAGS = -L$(RPP_LIB_DIR)
44
45 RPP_LDLIBS = -l:rpp-lib.lib $(TARGET_LDLIBS) -lpthread
46
47 $(RPP_LIB_DIR)/rpp-lib.lib:
48         $(MAKE) -C $(dir $@)