]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blob - rpp-test-sw/Makefile.inc
Recommend Debug build of the library with rpp-test-sw
[pes-rpp/rpp-test-sw.git] / rpp-test-sw / Makefile.inc
1 makefile_inc_dir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
2
3 all: rpp-test-sw.out
4
5 # Use the configuration "exported" by library build
6 CONFIG = $(makefile_inc_dir)/../rpp-lib/Makefile.config
7 ifneq ($(wildcard $(CONFIG)),)
8 include $(CONFIG)
9 else
10 $(error "rpp-lib not compiled! Either run `make -C $(makefile_inc_dir)/../rpp-lib/build/<target>/Debug` or build the appropriate CCS project.")
11 endif
12
13 include $(makefile_inc_dir)/../rpp-lib/build/Makefile.rules
14 include $(makefile_inc_dir)/../rpp-lib/common.mk
15 include $(makefile_inc_dir)/Makefile.var
16
17 OBJS = $(SOURCES:%.c=%.obj)
18
19 RPP_CFLAGS += -I$(makefile_inc_dir)/cmdproc/include -I$(makefile_inc_dir)
20 RPP_CFLAGS += -I. # For version.h
21
22 RPP_LDFLAGS += --heap_size=2048 # Assert requires stdio and it requires heap
23
24 rpp-test-sw.out: $(OBJS) $(RPP_LIB_DIR)/rpp-lib.lib
25         $(LD) $(RPP_CFLAGS) $(RPP_LDFLAGS) $(OBJS) $(RPP_LDLIBS) -o $@
26
27 $(makefile_inc_dir)/commands/main.c: version.h
28 $(makefile_inc_dir)/commands/cmd.c: version.h
29 include $(makefile_inc_dir)/Makefile.version
30
31 $(OBJS): %.obj: $(makefile_inc_dir)/%.c
32         $(call mkdir,$(dir $@))
33         $(RPP_COMPILE_CMD)
34
35 clean::
36         $(call rm,rpp-test-sw.out $(OBJS))
37
38 -include $(OBJS:%=%.dep)