-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (28 loc) · 963 Bytes
/
Makefile
File metadata and controls
36 lines (28 loc) · 963 Bytes
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
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
SRC = first_example.c
LIBRARY_NAME = app1
# Define the target rules
all: $(LIBRARY_NAME)
# Define header paths
INCLUDE_DIRS = -I$(JRTC_OUT_DIR)/inc -I$(NANO_PB) -I../jbpf_codelets/data_generator -I../jbpf_codelets/simple_input
# Define compiler flags
CFLAGS = -Wall -fPIC $(INCLUDE_DIRS) -fno-gnu-unique -g -DPB_FIELD_32BIT=1
# Link in Add jrtc_app.sh
LD_FLAGS=-L$(JRTC_APP_PATH) -ljrtc_app
# Rule to compile the C source code
$(LIBRARY_NAME):
for dir in ../jbpf_codelets/*; do \
make -C $$dir; \
done; \
make -C simple_agent_ipc; \
gcc -shared -o $(LIBRARY_NAME).so $(SRC) $(CFLAGS) $(LD_FLAGS)
# Clean rule to remove generated files and the shared library
clean:
for dir in ../jbpf_codelets/*; do \
make -C $$dir clean; \
done; \
make -C simple_agent_ipc clean; \
rm -f $(LIBRARY_NAME).so
# .PHONY is used to declare the targets that are not files
.PHONY: all clean