File tree Expand file tree Collapse file tree 2 files changed +45
-1
lines changed Expand file tree Collapse file tree 2 files changed +45
-1
lines changed Original file line number Diff line number Diff line change 24
24
.DS_Store
25
25
.directory
26
26
* .debug
27
- Makefile *
28
27
* .prl
29
28
* .app
30
29
moc_ * .cpp
Original file line number Diff line number Diff line change
1
+ #
2
+ # processWatchdog application makefile
3
+ # Copyright (c) 2023 Eray Ozturk <[email protected] >
4
+ #
5
+ CC := gcc
6
+ STRIP := strip
7
+
8
+ TARGET_EXEC := processWatchdog
9
+
10
+ SRC_DIRS := src
11
+ DEPLOY_DIR := .
12
+
13
+ SRCS := $(shell find $(SRC_DIRS ) -not -name 'main.c' -name '* .c')
14
+
15
+ INC_DIRS := $(shell find $(SRC_DIRS ) -type d)
16
+
17
+ INC_FLAGS := $(addprefix -I,$(INC_DIRS ) )
18
+
19
+ WARNING_FLAGS := -pedantic -Wall -Wextra -Wno-missing-declarations -Wstrict-prototypes -Wpointer-arith -Wwrite-strings -Wbad-function-cast -Wformat-security -Wno-discarded-qualifiers -Wno-implicit-fallthrough -Wformat-nonliteral -Wmissing-format-attribute -Wno-unused-variable -Wno-unused-parameter -Wno-unused-function -Wno-ignored-qualifiers -Wno-strict-prototypes -Wno-bad-function-cast -Wno-pointer-sign
20
+ HARDENING_FLAGS := -fno-builtin -fvisibility=hidden -fstack-protector -fno-omit-frame-pointer -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-common -ffunction-sections -fdata-sections
21
+ PERFORMANCE_FLAGS := -fPIC -fPIE -ffast-math -fassociative-math -fno-signed-zeros -fno-trapping-math -fno-exceptions
22
+
23
+ # debug
24
+ # CFLAGS := $(INC_FLAGS) -g3 -o0 -ggdb $(WARNING_FLAGS)
25
+
26
+ # release
27
+ CFLAGS := $(INC_FLAGS ) -g0 -o2 $(WARNING_FLAGS ) $(HARDENING_FLAGS ) $(PERFORMANCE_FLAGS )
28
+
29
+ LIBS := -lpthread -lm
30
+
31
+ all : $(TARGET_EXEC )
32
+
33
+ $(TARGET_EXEC ) :
34
+ $(CC ) $(SRCS ) $(CFLAGS ) $(EXTRA ) -o $(DEPLOY_DIR ) /$(TARGET_EXEC ) $(SRC_DIRS ) /main.c $(LIBS )
35
+ $(STRIP ) -R .comment -R * .note* -s -x -X -v $(DEPLOY_DIR ) /$(TARGET_EXEC )
36
+
37
+ .PHONY : clean
38
+ clean :
39
+ rm $(TARGET_EXEC )
40
+
41
+ .PHONY : install
42
+ install :
43
+ cp $(TARGET_EXEC ) ~ /
44
+ cp run.sh ~ /
45
+ chmod +x $(TARGET_EXEC ) run.sh
You can’t perform that action at this time.
0 commit comments