-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimer_build.mk
More file actions
34 lines (25 loc) · 1.03 KB
/
timer_build.mk
File metadata and controls
34 lines (25 loc) · 1.03 KB
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
# Timer API build configuration for Protocol Toolkit
# Add this to your main CMakeLists.txt or Makefile
# Timer library sources
TIMER_SOURCES = src/lib/ptk_timer.c
# Timer library headers
TIMER_HEADERS = src/include/ptk_timer.h
# Compiler flags for timer code
TIMER_CFLAGS = -Wall -Wextra -std=c99 -O2
# Debug build flags
TIMER_DEBUG_CFLAGS = -Wall -Wextra -std=c99 -g -DDEBUG
# Example build targets
timer_example: src/examples/timer_example.c $(TIMER_SOURCES)
$(CC) $(TIMER_CFLAGS) -I src/include -o timer_example \
src/examples/timer_example.c $(TIMER_SOURCES)
timer_example_debug: src/examples/timer_example.c $(TIMER_SOURCES)
$(CC) $(TIMER_DEBUG_CFLAGS) -I src/include -o timer_example_debug \
src/examples/timer_example.c $(TIMER_SOURCES)
# Static library build
libtimer.a: $(TIMER_SOURCES)
$(CC) $(TIMER_CFLAGS) -I src/include -c $(TIMER_SOURCES)
$(AR) rcs libtimer.a ptk_timer.o
# Clean timer artifacts
clean_timer:
rm -f timer_example timer_example_debug libtimer.a *.o
.PHONY: timer_example timer_example_debug clean_timer