]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blob - rpp-test-sw/Makefile.inc
Generate documentation correctly depending on the selected target
[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>/Release` 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-test-sw.out: $(OBJS) $(RPP_LIB_DIR)/rpp-lib.lib
23         $(LD) $(RPP_CFLAGS) $(RPP_LDFLAGS) $(OBJS) $(RPP_LDLIBS) -o $@
24
25 $(makefile_inc_dir)/commands/main.c: version.h
26 $(makefile_inc_dir)/commands/cmd.c: version.h
27 include $(makefile_inc_dir)/Makefile.version
28
29 $(OBJS): %.obj: $(makefile_inc_dir)/%.c
30         $(call mkdir,$(dir $@))
31         $(RPP_COMPILE_CMD)
32
33 clean::
34         $(call rm,rpp-test-sw.out $(OBJS))
35
36 -include $(OBJS:%=%.dep)