Revision 6d4ba740 configurations/HelloWorld/Makefile

View differences:

configurations/HelloWorld/Makefile
1 1
################################################################################
2 2
# AMiRo-Apps is a collection of applications for the Autonomous Mini Robot     #
3 3
# (AMiRo) platform.                                                            #
4
# Copyright (C) 2018..2019  Thomas Schöpping et al.                            #
4
# Copyright (C) 2018..2020  Thomas Schöpping et al.                            #
5 5
#                                                                              #
6 6
# This program is free software: you can redistribute it and/or modify         #
7 7
# it under the terms of the GNU General Public License as published by         #
......
26 26
# absolue path to this directory
27 27
HelloWorldCONF_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
28 28

  
29
# list of available modules
30
HelloWorldCONF_MODULES = $(patsubst $(HelloWorldCONF_DIR)/modules/%/,%,$(sort $(dir $(wildcard $(HelloWorldCONF_DIR)/modules/*/*))))
29
# list of available/supported modules
30
HelloWorldCONF_MODULES_DIR = $(HelloWorldCONF_DIR)/modules/
31
HelloWorldCONF_MODULES = $(patsubst $(HelloWorldCONF_MODULES_DIR)%/,%,$(sort $(dir $(wildcard $(HelloWorldCONF_MODULES_DIR)*/*))))
31 32

  
32
CLEANTRGS = $(HelloWorldCONF_MODULES:%=clean_%)
33
FLASHTRGS = $(HelloWorldCONF_MODULES:%=flash_%)
33
HelloWorldCONF_CLEANTRGS = $(HelloWorldCONF_MODULES:%=clean_%)
34
HelloWorldCONF_FLASHTRGS = $(HelloWorldCONF_MODULES:%=flash_%)
34 35

  
35
.PHONY: all $(MODULES) $(FLASHTRGS) clean $(CLEANTRGS)
36
.PHONY: all $(HelloWorldCONF_MODULES) $(HelloWorldCONF_FLASHTRGS) clean $(HelloWorldCONF_CLEANTRGS)
36 37

  
37 38
all: $(HelloWorldCONF_MODULES)
39

  
38 40
$(HelloWorldCONF_MODULES):
39
	$(MAKE) -C $(HelloWorldCONF_DIR)/modules/$@
41
	$(MAKE) -C $(HelloWorldCONF_MODULES_DIR)/$@
40 42

  
41
$(FLASHTRGS):
42
	$(MAKE) -C $(HelloWorldCONF_DIR)/modules/$(@:flash_%=%) flash
43
$(HelloWorldCONF_FLASHTRGS):
44
	$(MAKE) -C $(HelloWorldCONF_MODULES_DIR)/$(@:flash_%=%) flash
43 45

  
44
clean: $(CLEANTRGS)
45
$(CLEANTRGS):
46
	$(MAKE) -C $(HelloWorldCONF_DIR)/modules/$(@:clean_%=%) clean
46
clean: $(HelloWorldCONF_CLEANTRGS)
47
$(HelloWorldCONF_CLEANTRGS):
48
	$(MAKE) -C $(HelloWorldCONF_MODULES_DIR)/$(@:clean_%=%) clean

Also available in: Unified diff