-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile
85 lines (66 loc) · 3.1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
##
## Slightly corrected version of auto generated makefile by CodeLite IDE
##
## Build variables
ProjectName :=thermostat
SourceDirectory :=.
BuildDirectory :=./Build
ObjectSuffix :=.rel
IncludeSwitch :=-I
LibrarySwitch :=-l stm8
OutputSwitch :=-o
LibraryPathSwitch :=-L
SourceSwitch :=-c
LinkerName :=/usr/bin/sdcc
LinkOptions := --out-fmt-ihx -mstm8
OutputFile :=$(BuildDirectory)/$(ProjectName).ihx
ObjectSwitch :=-o
MakeDirCommand :=mkdir -p
IncludePath := $(IncludeSwitch). $(IncludeSwitch)./include
##
## Common variables
## CC and CFLAGS can be overriden using an environment variables
##
CC := /usr/bin/sdcc
CFLAGS := $(LibrarySwitch) -mstm8
##
## User defined environment variables
##
Objects=$(BuildDirectory)/ts.c$(ObjectSuffix) $(BuildDirectory)/display.c$(ObjectSuffix) $(BuildDirectory)/timer.c$(ObjectSuffix) $(BuildDirectory)/buttons.c$(ObjectSuffix) $(BuildDirectory)/adc.c$(ObjectSuffix) $(BuildDirectory)/menu.c$(ObjectSuffix) $(BuildDirectory)/params.c$(ObjectSuffix) $(BuildDirectory)/relay.c$(ObjectSuffix)
##
## Main Build Targets
##
.PHONY: all clean MakeBuildDirectory
all: $(OutputFile)
$(OutputFile): $(BuildDirectory)/.d $(Objects)
@$(MakeDirCommand) $(@D)
@echo "" > $(BuildDirectory)/.d
$(LinkerName) $(OutputSwitch)$(OutputFile) $(Objects) $(LinkOptions)
MakeBuildDirectory:
@test -d $(BuildDirectory) || $(MakeDirCommand) $(BuildDirectory)
$(BuildDirectory)/.d:
@test -d $(BuildDirectory) || $(MakeDirCommand) $(BuildDirectory)
##
## Objects
##
$(BuildDirectory)/ts.c$(ObjectSuffix): ts.c
$(CC) $(SourceSwitch) "$(SourceDirectory)/ts.c" $(CFLAGS) $(ObjectSwitch)$(BuildDirectory)/ts.c$(ObjectSuffix) $(IncludePath)
$(BuildDirectory)/display.c$(ObjectSuffix): display.c
$(CC) $(SourceSwitch) "$(SourceDirectory)/display.c" $(CFLAGS) $(ObjectSwitch)$(BuildDirectory)/display.c$(ObjectSuffix) $(IncludePath)
$(BuildDirectory)/timer.c$(ObjectSuffix): timer.c
$(CC) $(SourceSwitch) "$(SourceDirectory)/timer.c" $(CFLAGS) $(ObjectSwitch)$(BuildDirectory)/timer.c$(ObjectSuffix) $(IncludePath)
$(BuildDirectory)/buttons.c$(ObjectSuffix): buttons.c
$(CC) $(SourceSwitch) "$(SourceDirectory)/buttons.c" $(CFLAGS) $(ObjectSwitch)$(BuildDirectory)/buttons.c$(ObjectSuffix) $(IncludePath)
$(BuildDirectory)/adc.c$(ObjectSuffix): adc.c
$(CC) $(SourceSwitch) "$(SourceDirectory)/adc.c" $(CFLAGS) $(ObjectSwitch)$(BuildDirectory)/adc.c$(ObjectSuffix) $(IncludePath)
$(BuildDirectory)/menu.c$(ObjectSuffix): menu.c
$(CC) $(SourceSwitch) "$(SourceDirectory)/menu.c" $(CFLAGS) $(ObjectSwitch)$(BuildDirectory)/menu.c$(ObjectSuffix) $(IncludePath)
$(BuildDirectory)/params.c$(ObjectSuffix): params.c
$(CC) $(SourceSwitch) "$(SourceDirectory)/params.c" $(CFLAGS) $(ObjectSwitch)$(BuildDirectory)/params.c$(ObjectSuffix) $(IncludePath)
$(BuildDirectory)/relay.c$(ObjectSuffix): relay.c
$(CC) $(SourceSwitch) "$(SourceDirectory)/relay.c" $(CFLAGS) $(ObjectSwitch)$(BuildDirectory)/relay.c$(ObjectSuffix) $(IncludePath)
##
## Clean
##
clean:
$(RM) -r $(BuildDirectory)/