-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.mk
49 lines (39 loc) · 1.63 KB
/
common.mk
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
ifndef QCONFIG
QCONFIG=qconfig.mk
endif
include $(QCONFIG)
# The information in the .pinfo file generated by the build system is what will be displayed when
# `use <program name> -i info` is run in the command line.
# PINFO DESCRIPTION is the description that will be displayed in the above command
define PINFO
PINFO DESCRIPTION=CUInSpace fetcher
endef
### OUTPUT BINARY ###
NAME=fetcher
### COMPILER OPTIONS ###
CSTD = gnu11
OPTIMIZATION = -O2
### WARNINGS ###
# (see https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/Warning-Options.html)
WARNINGS += -Wall -Wextra -Wshadow -Wundef -Wformat=2 -Wtrampolines -Wfloat-equal
WARNINGS += -Wbad-function-cast -Wstrict-prototypes -Wpacked
WARNINGS += -Wno-aggressive-loop-optimizations -Winit-self -Wmissing-declarations
WARNINGS += -Wmissing-format-attribute -Wunreachable-code
WARNINGS += -Wshift-overflow=2 -Wduplicated-cond -Wpointer-arith -Wwrite-strings
WARNINGS += -Wnested-externs -Wcast-align -Wredundant-decls
WARNINGS += -Werror=implicit-function-declaration -Wlogical-not-parentheses
WARNINGS += -Wlogical-op -Wold-style-definition -Wcast-qual -Wdouble-promotion
WARNINGS += -Wunsuffixed-float-constants -Wmissing-include-dirs -Wnormalized
WARNINGS += -Wdisabled-optimization -Wsuggest-attribute=const
### UPDATE CFLAGS ###
CCFLAGS += -std=$(CSTD) $(OPTIMIZATION) $(WARNINGS)
# For logging utility
CCFLAGS += -DPROGNAME=$(NAME)
#### PROJECT SPECIFIC ####
### SOURCE FILES ###
SRC_SUBDIRECTORIES = $(shell find $(PROJECT_ROOT)/src -type d)
EXTRA_SRCVPATH += $(SRC_SUBDIRECTORIES)
EXTRA_SRCVPATH += $(PROJECT_ROOT)/../logging-utils
### EXTRA LIBRARIES ###
LIBS += i2c-master m
include $(MKFILES_ROOT)/qtargets.mk