]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - k3conf/k3conf.git/blob - Makefile
soc: j721s2: add device description information
[k3conf/k3conf.git] / Makefile
1 #/*
2 # * Makefile for k3conf
3 # *
4 # * Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com/
5 # *     Lokesh Vutla <lokeshvutla@ti.com>
6 # *
7 # *  Redistribution and use in source and binary forms, with or without
8 # *  modification, are permitted provided that the following conditions
9 # *  are met:
10 # *
11 # *    Redistributions of source code must retain the above copyright
12 # *    notice, this list of conditions and the following disclaimer.
13 # *
14 # *    Redistributions in binary form must reproduce the above copyright
15 # *    notice, this list of conditions and the following disclaimer in the
16 # *    documentation and/or other materials provided with the
17 # *    distribution.
18 # *
19 # *    Neither the name of Texas Instruments Incorporated nor the names of
20 # *    its contributors may be used to endorse or promote products derived
21 # *    from this software without specific prior written permission.
22 # *
23 # *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 # *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 # *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 # *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 # *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 # *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 # *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 # *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 # *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 # *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 # *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 # */
36 VERSION_MAJOR=0
37 VERSION_MINOR=2
39 CROSS_COMPILE ?=aarch64-linux-gnu-
40 CC = $(CROSS_COMPILE)gcc
42 DEF_INC := $(shell $(CROSS_COMPILE)gcc  -print-file-name=include)
44 DEF_INC_PATH = -I. -Iinclude
46 STATIC_BUILD ?= -static
48 MYCFLAGS+=$(CFLAGS) -c -Wall -Wextra -Wno-missing-field-initializers \
49                 -I$(DEF_INC) $(DEF_INC_PATH) $(STATIC_BUILD)
51 ifdef DEBUG
52 MYCFLAGS+=-g3 -fno-inline -O0 -DDEBUG
53 else
54 MYCFLAGS+=-Os
55 endif
57 DESTDIR ?= target
59 COMMONSOURCES=\
60                 common/k3conf.c \
61                 common/help.c \
62                 common/mmio.c \
63                 common/socinfo.c \
64                 common/sec_proxy.c \
65                 common/tisci/tisci_core.c \
66                 common/tisci/tisci_device.c \
67                 common/tisci/tisci_clock.c \
68                 common/autoadjust_table.c \
69                 common/cmd_show.c \
70                 common/cmd_dump.c \
71                 common/cmd_enable.c \
72                 common/cmd_disable.c \
73                 common/cmd_set.c \
74                 common/cmd_rw.c
76 AM65XSOURCES =\
77               soc/am65x/am65x_host_info.c \
78               soc/am65x/am65x_sec_proxy_info.c \
79               soc/am65x/am65x_processors_info.c \
80               soc/am65x/am65x_devices_info.c \
81               soc/am65x/am65x_clocks_info.c \
82               soc/am65x/am65x_rm_info.c \
83               soc/am65x_sr2/am65x_sr2_host_info.c \
84               soc/am65x_sr2/am65x_sr2_sec_proxy_info.c \
85               soc/am65x_sr2/am65x_sr2_processors_info.c \
86               soc/am65x_sr2/am65x_sr2_devices_info.c \
87               soc/am65x_sr2/am65x_sr2_clocks_info.c \
88               soc/am65x_sr2/am65x_sr2_rm_info.c
90 J721ESOURCES =\
91               soc/j721e/j721e_host_info.c \
92               soc/j721e/j721e_sec_proxy_info.c \
93               soc/j721e/j721e_processors_info.c \
94               soc/j721e/j721e_devices_info.c \
95               soc/j721e/j721e_clocks_info.c \
96               soc/j721e/j721e_rm_info.c \
97               soc/j7200/j7200_host_info.c \
98               soc/j7200/j7200_sec_proxy_info.c \
99               soc/j7200/j7200_processors_info.c \
100               soc/j7200/j7200_devices_info.c \
101               soc/j7200/j7200_clocks_info.c \
102               soc/j7200/j7200_rm_info.c
105 AM64XSOURCES =\
106               soc/am64x/am64x_host_info.c \
107               soc/am64x/am64x_sec_proxy_info.c \
108               soc/am64x/am64x_processors_info.c \
109               soc/am64x/am64x_devices_info.c \
110               soc/am64x/am64x_clocks_info.c \
111               soc/am64x/am64x_rm_info.c
113 AM62XSOURCES =\
114               soc/am62x/am62x_devices_info.c \
115               soc/am62x/am62x_clocks_info.c \
116               soc/am62x/am62x_host_info.c \
117               soc/am62x/am62x_processors_info.c \
118               soc/am62x/am62x_rm_info.c \
119               soc/am62x/am62x_sec_proxy_info.c
121 J721S2SOURCES =\
122               soc/j721s2/j721s2_devices_info.c
124 COMMONOBJECTS=  $(COMMONSOURCES:.c=.o)
125 AM65XOBJECTS=   $(AM65XSOURCES:.c=.o)
126 J721EOBJECTS=   $(J721ESOURCES:.c=.o)
127 AM64XOBJECTS=   $(AM64XSOURCES:.c=.o)
128 AM62XOBJECTS=   $(AM62XSOURCES:.c=.o)
129 J721S2OBJECTS=  $(J721S2SOURCES:.c=.o)
131 ALLSOURCES=     $(COMMONSOURCES) $(AM65XSOURCES) $(J721ESOURCES) \
132                 $(AM64XSOURCES) $(AM62XSOURCES) $(J721S2SOURCES)
134 ALLOBJECTS=     $(COMMONOBJECTS) $(AM65XOBJECTS) $(J721EOBJECTS) \
135                 $(AM64XOBJECTS) $(AM62XOBJECTS) $(J721S2OBJECTS)
138 # Pretty print
140 V             = @
141 Q             = $(V:1=)
142 QUIET_CC      = $(Q:@=@echo    '     CC       '$@;)
143 QUIET_GEN     = $(Q:@=@echo    '     GEN      '$@;)
144 QUIET_LINK    = $(Q:@=@echo    '     LINK     '$@;)
146 EXECUTABLE=     k3conf
148 .PHONY: tags cscope
150 all:            $(EXECUTABLE)
152 $(EXECUTABLE):  $(ALLOBJECTS) builddate.o version.o
153                 $(QUIET_CC) $(CC) $(STATIC_BUILD) $(LDFLAGS) $(ALLOBJECTS) builddate.o version.o\
154                 -lrt -o $@
156 .c.o:
157                 $(QUIET_CC) $(CC) $(MYCFLAGS) $(LDFLAGS) -c $< -o $@
159 builddate.c:    $(ALLOBJECTS)
160                 @echo 'char *builddate="'`date`'";' > builddate.c
162 version.c:      $(ALLOBJECTS)
163                 @echo 'char *k3conf_version="'`git describe --dirty 2>/dev/null||echo "$(VERSION_MAJOR).$(VERSION_MINOR)-nogit"`'";' > version.c
165 tags: $(ALLSOURCES)
166         ctags $(shell $(CC) $(MYCFLAGS) -MM -MG $(ALLSOURCES) |\
167                         sed -e "s/^.*\.o://g"|tr -d '\\')
169 cscope: $(ALLSOURCES)
170         cscope -R -b
172 clean:
173                 @echo "Cleaning up..."
174                 -$(shell rm -f $(EXECUTABLE) *.o builddate.c version.c)
175                 -$(shell rm -f $(ALLOBJECTS))
176                 -$(shell rm -f tags cscope.out)
177                 @echo "Done."