-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (38 loc) · 1.36 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
# Cross-Compiler executables and flags
TARGET_CC = bfin-uclinux-gcc
TARGET_CFLAGS = -Wall -Wno-long-long -pedantic -O2 -DOSC_TARGET
TARGET_LDFLAGS = -DOSC_TARGET -Wl,-elf2flt="-s 1048576" -lbfdsp
# Host-Compiler executables and flags
HOST_CC = gcc
HOST_CFLAGS = $(HOST_FEATURES) -Wall -Wno-long-long -pedantic -DOSC_HOST -g
HOST_LDFLAGS = -lm
PROJECTS = bmp cam cfg dma sup hello-world
TARGET_ONLY_PROJECTS = alarm
HOST_PROJETCS = $(addsuffix _host, $(PROJECTS))
TARGET_PROJETCS = $(addsuffix _target, $(PROJECTS) $(TARGET_ONLY_PROJECTS))
.PHONY: all
all: $(TARGET_PROJETCS) $(HOST_PROJETCS)
$(HOST_PROJETCS): %_host: %.c oscar/staging/lib/libosc_host.a
@ echo "Building $@ ..."
@ $(HOST_CC) $^ $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@
@ echo "Done."
$(TARGET_PROJETCS): %_target: %.c oscar/staging/lib/libosc_target.a
@ echo "Building $@ ..."
@ $(TARGET_CC) $^ $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -o $@
@ ! [ -d /tftpboot ] || cp $@ /tftpboot/$*
@ echo "Done."
oscar/staging/lib/libosc_host.a oscar/staging/lib/libosc_target.a:
make get
# Set symlinks
.PHONY: get
get:
@ echo "Configuring Oscar framework ..."
@ [ -d "../../oscar/" ] && ln -sf ../../oscar/ oscar
@ echo "Done."
.PHONY: clean
clean:
@ echo "Configuring Oscar framework ..."
@ rm -f $(HOST_PROJETCS) $(TARGET_PROJETCS)
@ rm -f modified.bmp osc_log osc_simlog
@ rm -f *.elf *.gdb *.o oscar
@ echo "Done."