-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (61 loc) · 2.06 KB
/
Makefile
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# this includes the framework configuration
-include .config
# decide whether we are building or dooing something other like cleaning or configuring
ifeq '' '$(filter $(MAKECMDGOALS), clean distclean config)'
# check whether a .config file has been found
ifeq '' '$(filter .config, $(MAKEFILE_LIST))'
$(error "Cannot make the target '$(MAKECMDGOALS)' without configuring the application. Please run make config to do this.")
endif
endif
# Compile options
PEDANTIC = # -pedantic
# Host-Compiler executables and flags
HOST_CC = gcc
HOST_CFLAGS = $(HOST_FEATURES) -Wall -Wno-long-long $(PEDANTIC) -D OSC_HOST
HOST_LDFLAGS = -lm
# Cross-Compiler executables and flags
TARGET_CC = bfin-uclinux-gcc
TARGET_CFLAGS = -Wall -Wno-long-long $(PEDANTIC) -O2 -D OSC_TARGET
TARGET_LDFLAGS = -Wl,-elf2flt="-s 2048" -lbfdsp
# Source files of the application
# Default target
.PHONY: all
all: netviewd debayer segment
debayer: debayer.c *.h inc/*.h lib/libosc_host.a
$(HOST_CC) debayer.c lib/libosc_host.a $(HOST_CFLAGS) -o $@
segment: segment.c *.h
$(HOST_CC) segment.c $(HOST_CFLAGS) -o $@
# Compiles the executable
netviewd: netviewd.c *.h inc/*.h lib/libosc_target.a
$(TARGET_CC) netviewd.c lib/libosc_target.a $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -o $@
# Compiles the executable
http-alt: http-alt.c *.h inc/*.h lib/libosc_target.a
$(TARGET_CC) http-alt.c lib/libosc_target.a $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -o $@
# Target to explicitly start the configuration process
.PHONY: config
config:
./configure
$(MAKE) --no-print-directory get
# Set symlinks to the framework
.PHONY: get
get:
rm -rf inc lib
ln -s $(CONFIG_FRAMEWORK)/staging/inc ./inc
ln -s $(CONFIG_FRAMEWORK)/staging/lib ./lib
@ echo "Configured Oscar framework."
# deploying to the device
.PHONY: deploy
deploy: netviewd
- scp -p $^ root@$(CONFIG_TARGET_IP):/bin/
@ echo "Application deployed."
# Cleanup
.PHONY: clean
clean:
rm -f netviewd debayer segment
rm -f *.o *.gdb
@ echo "Directory cleaned"
# Cleans everything not intended for source distribution
.PHONY: distclean
distclean: clean
rm -f .config
rm -rf inc lib