Subversion Repositories HomeAutomation

Rev

Rev 891 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 891 Rev 903
1
# Target file name (without extension).
1
# Target file name (without extension).
2
TARGET = main
2
TARGET = main
3
BIOSTARGET = bios
3
BIOSTARGET = bios
4
 
4
 
5
LIBDIR = ../../avr-lib
5
LIBDIR = ../../avr-lib
6
SRCDIR = src
6
SRCDIR = src
7
CFGDIR = .
7
CFGDIR = .
8
BIOSDIR = bios
8
BIOSDIR = bios
9
BIOSSRCDIR = $(LIBDIR)/bios
9
BIOSSRCDIR = $(LIBDIR)/bios
10
BUILDDIR = build
10
BUILDDIR = build
11
 
11
 
12
include bios.inc
12
include bios.inc
13
include ../system.inc
13
include ../system.inc
14
 
14
 
15
APPMAKEFLAGS = 	TARGET=$(TARGET) \
15
APPMAKEFLAGS = 	TARGET=$(TARGET) \
16
				LIBDIR=$(abspath $(LIBDIR)) \
16
				LIBDIR=$(abspath $(LIBDIR)) \
17
				SRCDIR=$(abspath $(SRCDIR)) \
17
				SRCDIR=$(abspath $(SRCDIR)) \
18
				BIOSDIR=$(abspath $(BIOSDIR)) \
18
				BIOSDIR=$(abspath $(BIOSDIR)) \
19
				CFGDIR=$(abspath $(CFGDIR)) 
19
				CFGDIR=$(abspath $(CFGDIR)) 
20
 
20
 
21
BIOSMAKEFLAGS = TARGET=$(BIOSTARGET) \
21
BIOSMAKEFLAGS = TARGET=$(BIOSTARGET) \
22
				LIBDIR=$(abspath $(LIBDIR)) \
22
				LIBDIR=$(abspath $(LIBDIR)) \
23
				SRCDIR=$(abspath $(BIOSSRCDIR)) \
23
				SRCDIR=$(abspath $(BIOSSRCDIR)) \
24
				CFGDIR=$(abspath $(CFGDIR)) 
24
				CFGDIR=$(abspath $(CFGDIR)) 
25
 
25
 
26
# Define Messages
26
# Define Messages
27
# English
27
# English
28
MSG_CLEANING = Cleaning project:
28
MSG_CLEANING = Cleaning project:
29
MSG_CREATEDIR = Creating directory:
29
MSG_CREATEDIR = Creating directory:
30
 
30
 
31
 
31
 
32
# Default target.
32
# Default target.
33
all: check_binaries $(abspath $(BUILDDIR))
33
all: check_binaries $(abspath $(BUILDDIR))
34
	@$(MAKE) $(APPMAKEFLAGS) -C $(BUILDDIR) -f $(abspath $(SRCDIR)/Makefile) all
34
	@$(MAKE) $(APPMAKEFLAGS) -C $(BUILDDIR) -f $(abspath $(SRCDIR)/Makefile) all
35
 
35
 
36
bios: check_binaries $(abspath $(BIOSDIR))
36
bios: check_binaries $(abspath $(BIOSDIR))
37
	@$(MAKE) $(BIOSMAKEFLAGS) -C $(BIOSDIR) -f $(abspath $(BIOSSRCDIR)/Makefile) all
37
	@$(MAKE) $(BIOSMAKEFLAGS) -C $(BIOSDIR) -f $(abspath $(BIOSSRCDIR)/Makefile) all
38
 
38
 
39
installbios: bios
39
installbios: bios
40
	$(UPLOAD) $(ULFLAGS)
40
	$(UPLOAD) $(ULFLAGS)
41
 
41
 
42
upgradebios: bios
42
upgradebios: bios
43
	$(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -i $(NODE_HW_ID) -f $(BIOSDIR)/$(BIOSTARGET).hex -r -b
43
	$(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -i $(NODE_HW_ID) -f $(BIOSDIR)/$(BIOSTARGET).hex -r -b
44
 
44
 
45
install: $(BUILDDIR)/$(TARGET).hex
45
install: $(BUILDDIR)/$(TARGET).hex
46
	$(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -i $(NODE_HW_ID) -f $< -r
46
	$(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -i $(NODE_HW_ID) -f $< -r
47
 
47
 
48
reset: 
48
reset: 
49
	$(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -i $(NODE_HW_ID) -r
49
	$(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -i $(NODE_HW_ID) -r
50
 
50
 
51
start: 
51
start: 
52
	$(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -i $(NODE_HW_ID) -s
52
	$(CANUPLOAD) $(CANULFLAGS) -n $(NODE_ID) -i $(NODE_HW_ID) -s
53
 
53
 
54
$(BUILDDIR)/$(TARGET).hex: check_binaries $(abspath $(BUILDDIR))
54
$(BUILDDIR)/$(TARGET).hex: check_binaries $(abspath $(BUILDDIR))
55
	@$(MAKE) $(APPMAKEFLAGS) -C $(BUILDDIR) -f $(abspath $(SRCDIR)/Makefile) $(TARGET).hex
55
	@$(MAKE) $(APPMAKEFLAGS) -C $(BUILDDIR) -f $(abspath $(SRCDIR)/Makefile) $(TARGET).hex
56
 
56
 
57
$(abspath $(BUILDDIR) $(BIOSDIR)): check_binaries
57
$(abspath $(BUILDDIR) $(BIOSDIR)): check_binaries
58
	@$(ECHO) $(MSG_CREATEDIR) $@
58
	@$(ECHO) $(MSG_CREATEDIR) $@
59
	@$(MKDIR) -p $@
59
	@$(MKDIR) -p $@
60
 
60
 
61
# Target: clean project.
61
# Target: clean project.
62
clean: check_binaries
62
clean: check_binaries
63
	@$(MAKE) $(APPMAKEFLAGS) -C $(BUILDDIR) -f $(abspath $(SRCDIR)/Makefile) clean
63
	@$(MAKE) $(APPMAKEFLAGS) -C $(BUILDDIR) -f $(abspath $(SRCDIR)/Makefile) clean
64
 
64
 
65
cleanbios: check_binaries
65
cleanbios: check_binaries
66
	@$(MAKE) $(BIOSMAKEFLAGS) -C $(BIOSDIR) -f $(abspath $(BIOSSRCDIR)/Makefile) clean
66
	@$(MAKE) $(BIOSMAKEFLAGS) -C $(BIOSDIR) -f $(abspath $(BIOSSRCDIR)/Makefile) clean
67
 
67
 
68
distclean: check_binaries
68
distclean: check_binaries
69
	@$(ECHO) $(MSG_CLEANING)
69
	@$(ECHO) $(MSG_CLEANING)
70
	$(RM) -r $(BUILDDIR)
70
	$(RM) -r $(BUILDDIR)
71
	$(RM) -r $(BIOSDIR)
71
	$(RM) -r $(BIOSDIR)
-
 
72
 
-
 
73
sethwid:
-
 
74
	@$(PERL) ../../../../PcSoftware/scripts/SetHwId/SetHwId.pl
72
 
75
 
73
check_binaries:
76
check_binaries:
74
ifndef MKDIR
77
ifndef MKDIR
75
	@echo 
78
	@echo 
76
	@echo ERROR! This is because you have not defined build-binaries in system.inc
79
	@echo ERROR! This is because you have not defined build-binaries in system.inc
77
	@echo Please update system.inc.template from SVN and then copy the build binaries definitions to your system.inc
80
	@echo Please update system.inc.template from SVN and then copy the build binaries definitions to your system.inc
78
	@echo 
81
	@echo 
79
	@false
82
	@false
80
endif
83
endif
81
 
84
 
82
# Listing of phony targets.
85
# Listing of phony targets.
83
.PHONY : all bios installbios upgradebios \
86
.PHONY : all bios installbios upgradebios \
84
install reset start \
87
install reset start \
85
clean cleanbios distclean check_binaries
88
clean cleanbios distclean check_binaries sethwid
86
 
89