-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
90 lines (64 loc) · 2.73 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Makefile
#
# ============================================================================
# Copyright (c) Texas Instruments Inc 2009
#
# Use of this software is controlled by the terms and conditions found in the
# license agreement under which this software has been supplied or provided.
# ============================================================================
ROOTDIR = /home/works/dvsdk_2_00_00_22
TARGET = $(notdir $(CURDIR))
include $(ROOTDIR)/Rules.make
# Comment this out if you want to see full compiler and linker output.
# VERBOSE = @
# Package path for the XDC tools
USER_XDC_PATH = /home/works/codecs;/home/works/av_codec
XDC_PATH = $(USER_XDC_PATH);../../packages;$(DMAI_INSTALL_DIR)/packages;$(CE_INSTALL_DIR)/packages;$(FC_INSTALL_DIR)/packages;$(LINK_INSTALL_DIR)/packages;$(XDAIS_INSTALL_DIR)/packages;$(CMEM_INSTALL_DIR)/packages;$(CODEC_INSTALL_DIR)/packages
# Where to output configuration files
XDC_CFG = $(TARGET)_config
# Output compiler options
XDC_CFLAGS = $(XDC_CFG)/compiler.opt
# Output linker file
XDC_LFILE = $(XDC_CFG)/linker.cmd
# Input configuration file
XDC_CFGFILE = $(TARGET).cfg
# Platform (board) to build for
XDC_PLATFORM = ti.platforms.evmDM6446
# Target tools
XDC_TARGET = gnu.targets.MVArm9
# The XDC configuration tool command line
CONFIGURO = $(XDC_INSTALL_DIR)/xs xdc.tools.configuro
C_FLAGS += -g -O2 -Wall -fPIC -DPIC -I/home/works/filesys/opt/include
LD_FLAGS += -shared -Wl,-lpthread -lpng -ljpeg -lfreetype -L/home/works/filesys/opt/lib -lmediastreamer -lortp -lspeex -lspeexdsp -lv4l1 -lv4l2 -lv4lconvert -lavcodec -lswscale -lavutil -lSDL -ldirectfb -lfusion -ldirect
COMPILE.c = $(VERBOSE) $(MVTOOL_PREFIX)gcc $(C_FLAGS) $(CPP_FLAGS) -c
LINK.c = $(VERBOSE) $(MVTOOL_PREFIX)gcc $(LD_FLAGS)
SOURCES = $(wildcard *.c) $(wildcard ../*.c)
HEADERS = $(wildcard *.h) $(wildcard ../*.h)
OBJFILES = $(SOURCES:%.c=%.o)
.PHONY: clean install
all: dm6446
dm6446: dm6446_al
dm6446_al: $(TARGET)
install: $(if $(wildcard $(TARGET)), install_$(TARGET))
install_$(TARGET):
@install -d $(EXEC_DIR)
@install $(TARGET) $(EXEC_DIR)
@install $(TARGET).txt $(EXEC_DIR)
@echo
@echo Installed $(TARGET) binaries to $(EXEC_DIR)..
$(TARGET): $(OBJFILES) $(XDC_LFILE)
@echo
@echo Linking $@ from $^..
$(LINK.c) -o $@ $^
$(OBJFILES): %.o: %.c $(HEADERS) $(XDC_CFLAGS)
@echo Compiling $@ from $<..
$(COMPILE.c) $(shell cat $(XDC_CFLAGS)) -o $@ $<
$(XDC_LFILE) $(XDC_CFLAGS): $(XDC_CFGFILE)
@echo
@echo ======== Building $(TARGET) ========
@echo Configuring application using $<
@echo
$(VERBOSE) XDCPATH="$(XDC_PATH)" $(CONFIGURO) -c $(MVTOOL_DIR) -o $(XDC_CFG) -t $(XDC_TARGET) -p $(XDC_PLATFORM) $(XDC_CFGFILE)
clean:
@echo Removing generated files..
$(VERBOSE) -$(RM) -rf $(XDC_CFG) $(OBJFILES) $(TARGET) *~ *.d .dep