aboutsummaryrefslogtreecommitdiffstats
path: root/labs
diff options
context:
space:
mode:
authorJason Reeder2015-08-06 16:09:40 -0500
committerJason Reeder2015-08-06 16:09:40 -0500
commit59330d73d71e90806a63cbd88505878f4167f1a9 (patch)
tree4a1de903f961b9ed61934e10c0dc96cbc5f1d0d6 /labs
parent6d1c85d4c0e058477e116ba97a02c8ab01a3c18d (diff)
downloadpru-software-support-package-59330d73d71e90806a63cbd88505878f4167f1a9.tar.gz
pru-software-support-package-59330d73d71e90806a63cbd88505878f4167f1a9.tar.xz
pru-software-support-package-59330d73d71e90806a63cbd88505878f4167f1a9.zip
Adding/Updating Makefiles
Adding Makefiles to the projects in the lab directories. Updating all Makefiles to print a useful error message if the proper environment variables are not set (PRU_CGT, ARM_CGT, and SW_DIR). Signed-off-by: Jason Reeder <jreeder@ti.com>
Diffstat (limited to 'labs')
-rw-r--r--labs/Makefile25
-rw-r--r--labs/lab_1/solution/toggle_led/Makefile86
-rw-r--r--labs/lab_2/solution/button_led_0/Makefile86
-rw-r--r--labs/lab_2/solution/button_led_1/Makefile86
-rw-r--r--labs/lab_3/solution/PRU_HDQ_TempSensor0/Makefile86
-rw-r--r--labs/lab_3/solution/PRU_HDQ_TempSensor1/Makefile86
-rw-r--r--labs/lab_4/solution/button_led_0/Makefile86
-rw-r--r--labs/lab_4/solution/button_led_1/Makefile86
-rw-r--r--labs/lab_5/solution/PRU_RPMsg_Echo_Interrupt1/Makefile86
-rw-r--r--labs/lab_6/solution/PRU_RPMsg_LED0/Makefile86
10 files changed, 799 insertions, 0 deletions
diff --git a/labs/Makefile b/labs/Makefile
new file mode 100644
index 0000000..61baf95
--- /dev/null
+++ b/labs/Makefile
@@ -0,0 +1,25 @@
1SUBDIRS=\
2lab_1/solution/toggle_led \
3lab_2/solution/button_led_0 \
4lab_2/solution/button_led_1 \
5lab_3/solution/PRU_HDQ_TempSensor0 \
6lab_3/solution/PRU_HDQ_TempSensor1 \
7lab_4/solution/button_led_0 \
8lab_4/solution/button_led_1 \
9lab_5/solution/PRU_RPMsg_Echo_Interrupt1 \
10lab_6/solution/PRU_RPMsg_LED0 \
11lab_7/solution/PRU_PID_0 \
12lab_7/solution/PRU_IO_1
13
14all: $(SUBDIRS)
15
16$(SUBDIRS):
17 @$(MAKE) -C $@
18
19clean:
20 @for d in $(SUBDIRS); do (cd $$d; $(MAKE) clean ); done
21
22.PHONY: all clean $(SUBDIRS)
23
24
25
diff --git a/labs/lab_1/solution/toggle_led/Makefile b/labs/lab_1/solution/toggle_led/Makefile
new file mode 100644
index 0000000..5c0c762
--- /dev/null
+++ b/labs/lab_1/solution/toggle_led/Makefile
@@ -0,0 +1,86 @@
1# PRU_CGT environment variable must point to the TI PRU compiler directory. E.g.:
2#(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
3#(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
4ifndef PRU_CGT
5define ERROR_BODY
6
7************************************************************
8PRU_CGT environment variable is not set. Examples given:
9(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
10(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
11************************************************************
12
13endef
14$(error $(ERROR_BODY))
15endif
16
17MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
18CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH))))
19PROJ_NAME=$(CURRENT_DIR)
20LINKER_COMMAND_FILE=./AM335x_PRU.cmd
21LIBS=--library=../../../../lib/rpmsg_lib.lib
22INCLUDE=--include_path=../../../../include
23STACK_SIZE=0x100
24HEAP_SIZE=0x100
25GEN_DIR=gen
26
27#Common compiler and linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
28CFLAGS=-v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=$(GEN_DIR) --pp_directory=$(GEN_DIR) -ppd -ppa
29#Linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
30LFLAGS=--reread_libs --warn_sections --stack_size=$(STACK_SIZE) --heap_size=$(HEAP_SIZE)
31
32TARGET=$(GEN_DIR)/$(PROJ_NAME).out
33MAP=$(GEN_DIR)/$(PROJ_NAME).map
34SOURCES=$(wildcard *.c)
35#Using .object instead of .obj in order to not conflict with the CCS build process
36OBJECTS=$(patsubst %,$(GEN_DIR)/%,$(SOURCES:.c=.object))
37
38all: printStart $(TARGET) printEnd
39
40printStart:
41 @echo ''
42 @echo '************************************************************'
43 @echo 'Building project: $(PROJ_NAME)'
44
45printEnd:
46 @echo ''
47 @echo 'Finished building project: $(PROJ_NAME)'
48 @echo '************************************************************'
49 @echo ''
50
51# Invokes the linker (-z flag) to make the .out file
52$(TARGET): $(OBJECTS) $(LINKER_COMMAND_FILE)
53 @echo ''
54 @echo 'Building target: $@'
55 @echo 'Invoking: PRU Linker'
56 $(PRU_CGT)/bin/clpru $(CFLAGS) -z -i$(PRU_CGT)/lib -i$(PRU_CGT)/include $(LFLAGS) -o $(TARGET) $(OBJECTS) -m$(MAP) $(LINKER_COMMAND_FILE) --library=libc.a $(LIBS)
57 @echo 'Finished building target: $@'
58 @echo ''
59 @echo 'Output files can be found in the "$(GEN_DIR)" directory'
60
61# Invokes the compiler on all c files in the directory to create the object files
62$(GEN_DIR)/%.object: %.c
63 @mkdir -p $(GEN_DIR)
64 @echo ''
65 @echo 'Building file: $<'
66 @echo 'Invoking: PRU Compiler'
67 $(PRU_CGT)/bin/clpru --include_path=$(PRU_CGT)/include $(INCLUDE) $(CFLAGS) -fe $@ $<
68
69.PHONY: all clean
70
71# Remove the $(GEN_DIR) directory
72clean:
73 @echo ''
74 @echo '************************************************************'
75 @echo 'Cleaning project: $(PROJ_NAME)'
76 @echo ''
77 @echo 'Removing files in the "$(GEN_DIR)" directory'
78 @rm -rf $(GEN_DIR)
79 @echo ''
80 @echo 'Finished cleaning project: $(PROJ_NAME)'
81 @echo '************************************************************'
82 @echo ''
83
84# Includes the dependencies that the compiler creates (-ppd and -ppa flags)
85-include $(OBJECTS:%.object=%.pp)
86
diff --git a/labs/lab_2/solution/button_led_0/Makefile b/labs/lab_2/solution/button_led_0/Makefile
new file mode 100644
index 0000000..5c0c762
--- /dev/null
+++ b/labs/lab_2/solution/button_led_0/Makefile
@@ -0,0 +1,86 @@
1# PRU_CGT environment variable must point to the TI PRU compiler directory. E.g.:
2#(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
3#(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
4ifndef PRU_CGT
5define ERROR_BODY
6
7************************************************************
8PRU_CGT environment variable is not set. Examples given:
9(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
10(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
11************************************************************
12
13endef
14$(error $(ERROR_BODY))
15endif
16
17MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
18CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH))))
19PROJ_NAME=$(CURRENT_DIR)
20LINKER_COMMAND_FILE=./AM335x_PRU.cmd
21LIBS=--library=../../../../lib/rpmsg_lib.lib
22INCLUDE=--include_path=../../../../include
23STACK_SIZE=0x100
24HEAP_SIZE=0x100
25GEN_DIR=gen
26
27#Common compiler and linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
28CFLAGS=-v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=$(GEN_DIR) --pp_directory=$(GEN_DIR) -ppd -ppa
29#Linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
30LFLAGS=--reread_libs --warn_sections --stack_size=$(STACK_SIZE) --heap_size=$(HEAP_SIZE)
31
32TARGET=$(GEN_DIR)/$(PROJ_NAME).out
33MAP=$(GEN_DIR)/$(PROJ_NAME).map
34SOURCES=$(wildcard *.c)
35#Using .object instead of .obj in order to not conflict with the CCS build process
36OBJECTS=$(patsubst %,$(GEN_DIR)/%,$(SOURCES:.c=.object))
37
38all: printStart $(TARGET) printEnd
39
40printStart:
41 @echo ''
42 @echo '************************************************************'
43 @echo 'Building project: $(PROJ_NAME)'
44
45printEnd:
46 @echo ''
47 @echo 'Finished building project: $(PROJ_NAME)'
48 @echo '************************************************************'
49 @echo ''
50
51# Invokes the linker (-z flag) to make the .out file
52$(TARGET): $(OBJECTS) $(LINKER_COMMAND_FILE)
53 @echo ''
54 @echo 'Building target: $@'
55 @echo 'Invoking: PRU Linker'
56 $(PRU_CGT)/bin/clpru $(CFLAGS) -z -i$(PRU_CGT)/lib -i$(PRU_CGT)/include $(LFLAGS) -o $(TARGET) $(OBJECTS) -m$(MAP) $(LINKER_COMMAND_FILE) --library=libc.a $(LIBS)
57 @echo 'Finished building target: $@'
58 @echo ''
59 @echo 'Output files can be found in the "$(GEN_DIR)" directory'
60
61# Invokes the compiler on all c files in the directory to create the object files
62$(GEN_DIR)/%.object: %.c
63 @mkdir -p $(GEN_DIR)
64 @echo ''
65 @echo 'Building file: $<'
66 @echo 'Invoking: PRU Compiler'
67 $(PRU_CGT)/bin/clpru --include_path=$(PRU_CGT)/include $(INCLUDE) $(CFLAGS) -fe $@ $<
68
69.PHONY: all clean
70
71# Remove the $(GEN_DIR) directory
72clean:
73 @echo ''
74 @echo '************************************************************'
75 @echo 'Cleaning project: $(PROJ_NAME)'
76 @echo ''
77 @echo 'Removing files in the "$(GEN_DIR)" directory'
78 @rm -rf $(GEN_DIR)
79 @echo ''
80 @echo 'Finished cleaning project: $(PROJ_NAME)'
81 @echo '************************************************************'
82 @echo ''
83
84# Includes the dependencies that the compiler creates (-ppd and -ppa flags)
85-include $(OBJECTS:%.object=%.pp)
86
diff --git a/labs/lab_2/solution/button_led_1/Makefile b/labs/lab_2/solution/button_led_1/Makefile
new file mode 100644
index 0000000..5c0c762
--- /dev/null
+++ b/labs/lab_2/solution/button_led_1/Makefile
@@ -0,0 +1,86 @@
1# PRU_CGT environment variable must point to the TI PRU compiler directory. E.g.:
2#(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
3#(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
4ifndef PRU_CGT
5define ERROR_BODY
6
7************************************************************
8PRU_CGT environment variable is not set. Examples given:
9(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
10(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
11************************************************************
12
13endef
14$(error $(ERROR_BODY))
15endif
16
17MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
18CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH))))
19PROJ_NAME=$(CURRENT_DIR)
20LINKER_COMMAND_FILE=./AM335x_PRU.cmd
21LIBS=--library=../../../../lib/rpmsg_lib.lib
22INCLUDE=--include_path=../../../../include
23STACK_SIZE=0x100
24HEAP_SIZE=0x100
25GEN_DIR=gen
26
27#Common compiler and linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
28CFLAGS=-v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=$(GEN_DIR) --pp_directory=$(GEN_DIR) -ppd -ppa
29#Linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
30LFLAGS=--reread_libs --warn_sections --stack_size=$(STACK_SIZE) --heap_size=$(HEAP_SIZE)
31
32TARGET=$(GEN_DIR)/$(PROJ_NAME).out
33MAP=$(GEN_DIR)/$(PROJ_NAME).map
34SOURCES=$(wildcard *.c)
35#Using .object instead of .obj in order to not conflict with the CCS build process
36OBJECTS=$(patsubst %,$(GEN_DIR)/%,$(SOURCES:.c=.object))
37
38all: printStart $(TARGET) printEnd
39
40printStart:
41 @echo ''
42 @echo '************************************************************'
43 @echo 'Building project: $(PROJ_NAME)'
44
45printEnd:
46 @echo ''
47 @echo 'Finished building project: $(PROJ_NAME)'
48 @echo '************************************************************'
49 @echo ''
50
51# Invokes the linker (-z flag) to make the .out file
52$(TARGET): $(OBJECTS) $(LINKER_COMMAND_FILE)
53 @echo ''
54 @echo 'Building target: $@'
55 @echo 'Invoking: PRU Linker'
56 $(PRU_CGT)/bin/clpru $(CFLAGS) -z -i$(PRU_CGT)/lib -i$(PRU_CGT)/include $(LFLAGS) -o $(TARGET) $(OBJECTS) -m$(MAP) $(LINKER_COMMAND_FILE) --library=libc.a $(LIBS)
57 @echo 'Finished building target: $@'
58 @echo ''
59 @echo 'Output files can be found in the "$(GEN_DIR)" directory'
60
61# Invokes the compiler on all c files in the directory to create the object files
62$(GEN_DIR)/%.object: %.c
63 @mkdir -p $(GEN_DIR)
64 @echo ''
65 @echo 'Building file: $<'
66 @echo 'Invoking: PRU Compiler'
67 $(PRU_CGT)/bin/clpru --include_path=$(PRU_CGT)/include $(INCLUDE) $(CFLAGS) -fe $@ $<
68
69.PHONY: all clean
70
71# Remove the $(GEN_DIR) directory
72clean:
73 @echo ''
74 @echo '************************************************************'
75 @echo 'Cleaning project: $(PROJ_NAME)'
76 @echo ''
77 @echo 'Removing files in the "$(GEN_DIR)" directory'
78 @rm -rf $(GEN_DIR)
79 @echo ''
80 @echo 'Finished cleaning project: $(PROJ_NAME)'
81 @echo '************************************************************'
82 @echo ''
83
84# Includes the dependencies that the compiler creates (-ppd and -ppa flags)
85-include $(OBJECTS:%.object=%.pp)
86
diff --git a/labs/lab_3/solution/PRU_HDQ_TempSensor0/Makefile b/labs/lab_3/solution/PRU_HDQ_TempSensor0/Makefile
new file mode 100644
index 0000000..5c0c762
--- /dev/null
+++ b/labs/lab_3/solution/PRU_HDQ_TempSensor0/Makefile
@@ -0,0 +1,86 @@
1# PRU_CGT environment variable must point to the TI PRU compiler directory. E.g.:
2#(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
3#(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
4ifndef PRU_CGT
5define ERROR_BODY
6
7************************************************************
8PRU_CGT environment variable is not set. Examples given:
9(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
10(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
11************************************************************
12
13endef
14$(error $(ERROR_BODY))
15endif
16
17MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
18CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH))))
19PROJ_NAME=$(CURRENT_DIR)
20LINKER_COMMAND_FILE=./AM335x_PRU.cmd
21LIBS=--library=../../../../lib/rpmsg_lib.lib
22INCLUDE=--include_path=../../../../include
23STACK_SIZE=0x100
24HEAP_SIZE=0x100
25GEN_DIR=gen
26
27#Common compiler and linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
28CFLAGS=-v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=$(GEN_DIR) --pp_directory=$(GEN_DIR) -ppd -ppa
29#Linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
30LFLAGS=--reread_libs --warn_sections --stack_size=$(STACK_SIZE) --heap_size=$(HEAP_SIZE)
31
32TARGET=$(GEN_DIR)/$(PROJ_NAME).out
33MAP=$(GEN_DIR)/$(PROJ_NAME).map
34SOURCES=$(wildcard *.c)
35#Using .object instead of .obj in order to not conflict with the CCS build process
36OBJECTS=$(patsubst %,$(GEN_DIR)/%,$(SOURCES:.c=.object))
37
38all: printStart $(TARGET) printEnd
39
40printStart:
41 @echo ''
42 @echo '************************************************************'
43 @echo 'Building project: $(PROJ_NAME)'
44
45printEnd:
46 @echo ''
47 @echo 'Finished building project: $(PROJ_NAME)'
48 @echo '************************************************************'
49 @echo ''
50
51# Invokes the linker (-z flag) to make the .out file
52$(TARGET): $(OBJECTS) $(LINKER_COMMAND_FILE)
53 @echo ''
54 @echo 'Building target: $@'
55 @echo 'Invoking: PRU Linker'
56 $(PRU_CGT)/bin/clpru $(CFLAGS) -z -i$(PRU_CGT)/lib -i$(PRU_CGT)/include $(LFLAGS) -o $(TARGET) $(OBJECTS) -m$(MAP) $(LINKER_COMMAND_FILE) --library=libc.a $(LIBS)
57 @echo 'Finished building target: $@'
58 @echo ''
59 @echo 'Output files can be found in the "$(GEN_DIR)" directory'
60
61# Invokes the compiler on all c files in the directory to create the object files
62$(GEN_DIR)/%.object: %.c
63 @mkdir -p $(GEN_DIR)
64 @echo ''
65 @echo 'Building file: $<'
66 @echo 'Invoking: PRU Compiler'
67 $(PRU_CGT)/bin/clpru --include_path=$(PRU_CGT)/include $(INCLUDE) $(CFLAGS) -fe $@ $<
68
69.PHONY: all clean
70
71# Remove the $(GEN_DIR) directory
72clean:
73 @echo ''
74 @echo '************************************************************'
75 @echo 'Cleaning project: $(PROJ_NAME)'
76 @echo ''
77 @echo 'Removing files in the "$(GEN_DIR)" directory'
78 @rm -rf $(GEN_DIR)
79 @echo ''
80 @echo 'Finished cleaning project: $(PROJ_NAME)'
81 @echo '************************************************************'
82 @echo ''
83
84# Includes the dependencies that the compiler creates (-ppd and -ppa flags)
85-include $(OBJECTS:%.object=%.pp)
86
diff --git a/labs/lab_3/solution/PRU_HDQ_TempSensor1/Makefile b/labs/lab_3/solution/PRU_HDQ_TempSensor1/Makefile
new file mode 100644
index 0000000..5c0c762
--- /dev/null
+++ b/labs/lab_3/solution/PRU_HDQ_TempSensor1/Makefile
@@ -0,0 +1,86 @@
1# PRU_CGT environment variable must point to the TI PRU compiler directory. E.g.:
2#(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
3#(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
4ifndef PRU_CGT
5define ERROR_BODY
6
7************************************************************
8PRU_CGT environment variable is not set. Examples given:
9(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
10(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
11************************************************************
12
13endef
14$(error $(ERROR_BODY))
15endif
16
17MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
18CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH))))
19PROJ_NAME=$(CURRENT_DIR)
20LINKER_COMMAND_FILE=./AM335x_PRU.cmd
21LIBS=--library=../../../../lib/rpmsg_lib.lib
22INCLUDE=--include_path=../../../../include
23STACK_SIZE=0x100
24HEAP_SIZE=0x100
25GEN_DIR=gen
26
27#Common compiler and linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
28CFLAGS=-v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=$(GEN_DIR) --pp_directory=$(GEN_DIR) -ppd -ppa
29#Linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
30LFLAGS=--reread_libs --warn_sections --stack_size=$(STACK_SIZE) --heap_size=$(HEAP_SIZE)
31
32TARGET=$(GEN_DIR)/$(PROJ_NAME).out
33MAP=$(GEN_DIR)/$(PROJ_NAME).map
34SOURCES=$(wildcard *.c)
35#Using .object instead of .obj in order to not conflict with the CCS build process
36OBJECTS=$(patsubst %,$(GEN_DIR)/%,$(SOURCES:.c=.object))
37
38all: printStart $(TARGET) printEnd
39
40printStart:
41 @echo ''
42 @echo '************************************************************'
43 @echo 'Building project: $(PROJ_NAME)'
44
45printEnd:
46 @echo ''
47 @echo 'Finished building project: $(PROJ_NAME)'
48 @echo '************************************************************'
49 @echo ''
50
51# Invokes the linker (-z flag) to make the .out file
52$(TARGET): $(OBJECTS) $(LINKER_COMMAND_FILE)
53 @echo ''
54 @echo 'Building target: $@'
55 @echo 'Invoking: PRU Linker'
56 $(PRU_CGT)/bin/clpru $(CFLAGS) -z -i$(PRU_CGT)/lib -i$(PRU_CGT)/include $(LFLAGS) -o $(TARGET) $(OBJECTS) -m$(MAP) $(LINKER_COMMAND_FILE) --library=libc.a $(LIBS)
57 @echo 'Finished building target: $@'
58 @echo ''
59 @echo 'Output files can be found in the "$(GEN_DIR)" directory'
60
61# Invokes the compiler on all c files in the directory to create the object files
62$(GEN_DIR)/%.object: %.c
63 @mkdir -p $(GEN_DIR)
64 @echo ''
65 @echo 'Building file: $<'
66 @echo 'Invoking: PRU Compiler'
67 $(PRU_CGT)/bin/clpru --include_path=$(PRU_CGT)/include $(INCLUDE) $(CFLAGS) -fe $@ $<
68
69.PHONY: all clean
70
71# Remove the $(GEN_DIR) directory
72clean:
73 @echo ''
74 @echo '************************************************************'
75 @echo 'Cleaning project: $(PROJ_NAME)'
76 @echo ''
77 @echo 'Removing files in the "$(GEN_DIR)" directory'
78 @rm -rf $(GEN_DIR)
79 @echo ''
80 @echo 'Finished cleaning project: $(PROJ_NAME)'
81 @echo '************************************************************'
82 @echo ''
83
84# Includes the dependencies that the compiler creates (-ppd and -ppa flags)
85-include $(OBJECTS:%.object=%.pp)
86
diff --git a/labs/lab_4/solution/button_led_0/Makefile b/labs/lab_4/solution/button_led_0/Makefile
new file mode 100644
index 0000000..5c0c762
--- /dev/null
+++ b/labs/lab_4/solution/button_led_0/Makefile
@@ -0,0 +1,86 @@
1# PRU_CGT environment variable must point to the TI PRU compiler directory. E.g.:
2#(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
3#(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
4ifndef PRU_CGT
5define ERROR_BODY
6
7************************************************************
8PRU_CGT environment variable is not set. Examples given:
9(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
10(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
11************************************************************
12
13endef
14$(error $(ERROR_BODY))
15endif
16
17MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
18CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH))))
19PROJ_NAME=$(CURRENT_DIR)
20LINKER_COMMAND_FILE=./AM335x_PRU.cmd
21LIBS=--library=../../../../lib/rpmsg_lib.lib
22INCLUDE=--include_path=../../../../include
23STACK_SIZE=0x100
24HEAP_SIZE=0x100
25GEN_DIR=gen
26
27#Common compiler and linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
28CFLAGS=-v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=$(GEN_DIR) --pp_directory=$(GEN_DIR) -ppd -ppa
29#Linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
30LFLAGS=--reread_libs --warn_sections --stack_size=$(STACK_SIZE) --heap_size=$(HEAP_SIZE)
31
32TARGET=$(GEN_DIR)/$(PROJ_NAME).out
33MAP=$(GEN_DIR)/$(PROJ_NAME).map
34SOURCES=$(wildcard *.c)
35#Using .object instead of .obj in order to not conflict with the CCS build process
36OBJECTS=$(patsubst %,$(GEN_DIR)/%,$(SOURCES:.c=.object))
37
38all: printStart $(TARGET) printEnd
39
40printStart:
41 @echo ''
42 @echo '************************************************************'
43 @echo 'Building project: $(PROJ_NAME)'
44
45printEnd:
46 @echo ''
47 @echo 'Finished building project: $(PROJ_NAME)'
48 @echo '************************************************************'
49 @echo ''
50
51# Invokes the linker (-z flag) to make the .out file
52$(TARGET): $(OBJECTS) $(LINKER_COMMAND_FILE)
53 @echo ''
54 @echo 'Building target: $@'
55 @echo 'Invoking: PRU Linker'
56 $(PRU_CGT)/bin/clpru $(CFLAGS) -z -i$(PRU_CGT)/lib -i$(PRU_CGT)/include $(LFLAGS) -o $(TARGET) $(OBJECTS) -m$(MAP) $(LINKER_COMMAND_FILE) --library=libc.a $(LIBS)
57 @echo 'Finished building target: $@'
58 @echo ''
59 @echo 'Output files can be found in the "$(GEN_DIR)" directory'
60
61# Invokes the compiler on all c files in the directory to create the object files
62$(GEN_DIR)/%.object: %.c
63 @mkdir -p $(GEN_DIR)
64 @echo ''
65 @echo 'Building file: $<'
66 @echo 'Invoking: PRU Compiler'
67 $(PRU_CGT)/bin/clpru --include_path=$(PRU_CGT)/include $(INCLUDE) $(CFLAGS) -fe $@ $<
68
69.PHONY: all clean
70
71# Remove the $(GEN_DIR) directory
72clean:
73 @echo ''
74 @echo '************************************************************'
75 @echo 'Cleaning project: $(PROJ_NAME)'
76 @echo ''
77 @echo 'Removing files in the "$(GEN_DIR)" directory'
78 @rm -rf $(GEN_DIR)
79 @echo ''
80 @echo 'Finished cleaning project: $(PROJ_NAME)'
81 @echo '************************************************************'
82 @echo ''
83
84# Includes the dependencies that the compiler creates (-ppd and -ppa flags)
85-include $(OBJECTS:%.object=%.pp)
86
diff --git a/labs/lab_4/solution/button_led_1/Makefile b/labs/lab_4/solution/button_led_1/Makefile
new file mode 100644
index 0000000..5c0c762
--- /dev/null
+++ b/labs/lab_4/solution/button_led_1/Makefile
@@ -0,0 +1,86 @@
1# PRU_CGT environment variable must point to the TI PRU compiler directory. E.g.:
2#(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
3#(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
4ifndef PRU_CGT
5define ERROR_BODY
6
7************************************************************
8PRU_CGT environment variable is not set. Examples given:
9(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
10(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
11************************************************************
12
13endef
14$(error $(ERROR_BODY))
15endif
16
17MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
18CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH))))
19PROJ_NAME=$(CURRENT_DIR)
20LINKER_COMMAND_FILE=./AM335x_PRU.cmd
21LIBS=--library=../../../../lib/rpmsg_lib.lib
22INCLUDE=--include_path=../../../../include
23STACK_SIZE=0x100
24HEAP_SIZE=0x100
25GEN_DIR=gen
26
27#Common compiler and linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
28CFLAGS=-v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=$(GEN_DIR) --pp_directory=$(GEN_DIR) -ppd -ppa
29#Linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
30LFLAGS=--reread_libs --warn_sections --stack_size=$(STACK_SIZE) --heap_size=$(HEAP_SIZE)
31
32TARGET=$(GEN_DIR)/$(PROJ_NAME).out
33MAP=$(GEN_DIR)/$(PROJ_NAME).map
34SOURCES=$(wildcard *.c)
35#Using .object instead of .obj in order to not conflict with the CCS build process
36OBJECTS=$(patsubst %,$(GEN_DIR)/%,$(SOURCES:.c=.object))
37
38all: printStart $(TARGET) printEnd
39
40printStart:
41 @echo ''
42 @echo '************************************************************'
43 @echo 'Building project: $(PROJ_NAME)'
44
45printEnd:
46 @echo ''
47 @echo 'Finished building project: $(PROJ_NAME)'
48 @echo '************************************************************'
49 @echo ''
50
51# Invokes the linker (-z flag) to make the .out file
52$(TARGET): $(OBJECTS) $(LINKER_COMMAND_FILE)
53 @echo ''
54 @echo 'Building target: $@'
55 @echo 'Invoking: PRU Linker'
56 $(PRU_CGT)/bin/clpru $(CFLAGS) -z -i$(PRU_CGT)/lib -i$(PRU_CGT)/include $(LFLAGS) -o $(TARGET) $(OBJECTS) -m$(MAP) $(LINKER_COMMAND_FILE) --library=libc.a $(LIBS)
57 @echo 'Finished building target: $@'
58 @echo ''
59 @echo 'Output files can be found in the "$(GEN_DIR)" directory'
60
61# Invokes the compiler on all c files in the directory to create the object files
62$(GEN_DIR)/%.object: %.c
63 @mkdir -p $(GEN_DIR)
64 @echo ''
65 @echo 'Building file: $<'
66 @echo 'Invoking: PRU Compiler'
67 $(PRU_CGT)/bin/clpru --include_path=$(PRU_CGT)/include $(INCLUDE) $(CFLAGS) -fe $@ $<
68
69.PHONY: all clean
70
71# Remove the $(GEN_DIR) directory
72clean:
73 @echo ''
74 @echo '************************************************************'
75 @echo 'Cleaning project: $(PROJ_NAME)'
76 @echo ''
77 @echo 'Removing files in the "$(GEN_DIR)" directory'
78 @rm -rf $(GEN_DIR)
79 @echo ''
80 @echo 'Finished cleaning project: $(PROJ_NAME)'
81 @echo '************************************************************'
82 @echo ''
83
84# Includes the dependencies that the compiler creates (-ppd and -ppa flags)
85-include $(OBJECTS:%.object=%.pp)
86
diff --git a/labs/lab_5/solution/PRU_RPMsg_Echo_Interrupt1/Makefile b/labs/lab_5/solution/PRU_RPMsg_Echo_Interrupt1/Makefile
new file mode 100644
index 0000000..5c0c762
--- /dev/null
+++ b/labs/lab_5/solution/PRU_RPMsg_Echo_Interrupt1/Makefile
@@ -0,0 +1,86 @@
1# PRU_CGT environment variable must point to the TI PRU compiler directory. E.g.:
2#(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
3#(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
4ifndef PRU_CGT
5define ERROR_BODY
6
7************************************************************
8PRU_CGT environment variable is not set. Examples given:
9(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
10(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
11************************************************************
12
13endef
14$(error $(ERROR_BODY))
15endif
16
17MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
18CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH))))
19PROJ_NAME=$(CURRENT_DIR)
20LINKER_COMMAND_FILE=./AM335x_PRU.cmd
21LIBS=--library=../../../../lib/rpmsg_lib.lib
22INCLUDE=--include_path=../../../../include
23STACK_SIZE=0x100
24HEAP_SIZE=0x100
25GEN_DIR=gen
26
27#Common compiler and linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
28CFLAGS=-v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=$(GEN_DIR) --pp_directory=$(GEN_DIR) -ppd -ppa
29#Linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
30LFLAGS=--reread_libs --warn_sections --stack_size=$(STACK_SIZE) --heap_size=$(HEAP_SIZE)
31
32TARGET=$(GEN_DIR)/$(PROJ_NAME).out
33MAP=$(GEN_DIR)/$(PROJ_NAME).map
34SOURCES=$(wildcard *.c)
35#Using .object instead of .obj in order to not conflict with the CCS build process
36OBJECTS=$(patsubst %,$(GEN_DIR)/%,$(SOURCES:.c=.object))
37
38all: printStart $(TARGET) printEnd
39
40printStart:
41 @echo ''
42 @echo '************************************************************'
43 @echo 'Building project: $(PROJ_NAME)'
44
45printEnd:
46 @echo ''
47 @echo 'Finished building project: $(PROJ_NAME)'
48 @echo '************************************************************'
49 @echo ''
50
51# Invokes the linker (-z flag) to make the .out file
52$(TARGET): $(OBJECTS) $(LINKER_COMMAND_FILE)
53 @echo ''
54 @echo 'Building target: $@'
55 @echo 'Invoking: PRU Linker'
56 $(PRU_CGT)/bin/clpru $(CFLAGS) -z -i$(PRU_CGT)/lib -i$(PRU_CGT)/include $(LFLAGS) -o $(TARGET) $(OBJECTS) -m$(MAP) $(LINKER_COMMAND_FILE) --library=libc.a $(LIBS)
57 @echo 'Finished building target: $@'
58 @echo ''
59 @echo 'Output files can be found in the "$(GEN_DIR)" directory'
60
61# Invokes the compiler on all c files in the directory to create the object files
62$(GEN_DIR)/%.object: %.c
63 @mkdir -p $(GEN_DIR)
64 @echo ''
65 @echo 'Building file: $<'
66 @echo 'Invoking: PRU Compiler'
67 $(PRU_CGT)/bin/clpru --include_path=$(PRU_CGT)/include $(INCLUDE) $(CFLAGS) -fe $@ $<
68
69.PHONY: all clean
70
71# Remove the $(GEN_DIR) directory
72clean:
73 @echo ''
74 @echo '************************************************************'
75 @echo 'Cleaning project: $(PROJ_NAME)'
76 @echo ''
77 @echo 'Removing files in the "$(GEN_DIR)" directory'
78 @rm -rf $(GEN_DIR)
79 @echo ''
80 @echo 'Finished cleaning project: $(PROJ_NAME)'
81 @echo '************************************************************'
82 @echo ''
83
84# Includes the dependencies that the compiler creates (-ppd and -ppa flags)
85-include $(OBJECTS:%.object=%.pp)
86
diff --git a/labs/lab_6/solution/PRU_RPMsg_LED0/Makefile b/labs/lab_6/solution/PRU_RPMsg_LED0/Makefile
new file mode 100644
index 0000000..5c0c762
--- /dev/null
+++ b/labs/lab_6/solution/PRU_RPMsg_LED0/Makefile
@@ -0,0 +1,86 @@
1# PRU_CGT environment variable must point to the TI PRU compiler directory. E.g.:
2#(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
3#(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
4ifndef PRU_CGT
5define ERROR_BODY
6
7************************************************************
8PRU_CGT environment variable is not set. Examples given:
9(Linux) export PRU_CGT=/home/jason/ti/ccs_v6_1_0/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
10(Windows) set PRU_CGT=C:/TI/ccs_v6_0_1/ccsv6/tools/compiler/ti-cgt-pru_2.1.0
11************************************************************
12
13endef
14$(error $(ERROR_BODY))
15endif
16
17MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
18CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH))))
19PROJ_NAME=$(CURRENT_DIR)
20LINKER_COMMAND_FILE=./AM335x_PRU.cmd
21LIBS=--library=../../../../lib/rpmsg_lib.lib
22INCLUDE=--include_path=../../../../include
23STACK_SIZE=0x100
24HEAP_SIZE=0x100
25GEN_DIR=gen
26
27#Common compiler and linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
28CFLAGS=-v3 -O2 --display_error_number --endian=little --hardware_mac=on --obj_directory=$(GEN_DIR) --pp_directory=$(GEN_DIR) -ppd -ppa
29#Linker flags (Defined in 'PRU Optimizing C/C++ Compiler User's Guide)
30LFLAGS=--reread_libs --warn_sections --stack_size=$(STACK_SIZE) --heap_size=$(HEAP_SIZE)
31
32TARGET=$(GEN_DIR)/$(PROJ_NAME).out
33MAP=$(GEN_DIR)/$(PROJ_NAME).map
34SOURCES=$(wildcard *.c)
35#Using .object instead of .obj in order to not conflict with the CCS build process
36OBJECTS=$(patsubst %,$(GEN_DIR)/%,$(SOURCES:.c=.object))
37
38all: printStart $(TARGET) printEnd
39
40printStart:
41 @echo ''
42 @echo '************************************************************'
43 @echo 'Building project: $(PROJ_NAME)'
44
45printEnd:
46 @echo ''
47 @echo 'Finished building project: $(PROJ_NAME)'
48 @echo '************************************************************'
49 @echo ''
50
51# Invokes the linker (-z flag) to make the .out file
52$(TARGET): $(OBJECTS) $(LINKER_COMMAND_FILE)
53 @echo ''
54 @echo 'Building target: $@'
55 @echo 'Invoking: PRU Linker'
56 $(PRU_CGT)/bin/clpru $(CFLAGS) -z -i$(PRU_CGT)/lib -i$(PRU_CGT)/include $(LFLAGS) -o $(TARGET) $(OBJECTS) -m$(MAP) $(LINKER_COMMAND_FILE) --library=libc.a $(LIBS)
57 @echo 'Finished building target: $@'
58 @echo ''
59 @echo 'Output files can be found in the "$(GEN_DIR)" directory'
60
61# Invokes the compiler on all c files in the directory to create the object files
62$(GEN_DIR)/%.object: %.c
63 @mkdir -p $(GEN_DIR)
64 @echo ''
65 @echo 'Building file: $<'
66 @echo 'Invoking: PRU Compiler'
67 $(PRU_CGT)/bin/clpru --include_path=$(PRU_CGT)/include $(INCLUDE) $(CFLAGS) -fe $@ $<
68
69.PHONY: all clean
70
71# Remove the $(GEN_DIR) directory
72clean:
73 @echo ''
74 @echo '************************************************************'
75 @echo 'Cleaning project: $(PROJ_NAME)'
76 @echo ''
77 @echo 'Removing files in the "$(GEN_DIR)" directory'
78 @rm -rf $(GEN_DIR)
79 @echo ''
80 @echo 'Finished cleaning project: $(PROJ_NAME)'
81 @echo '************************************************************'
82 @echo ''
83
84# Includes the dependencies that the compiler creates (-ppd and -ppa flags)
85-include $(OBJECTS:%.object=%.pp)
86