• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (c) 2022 FuZhou Lockzhiner Electronic Co., Ltd. All rights reserved.
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
16TARGET = liteos
17ELF_FILE = $(ELFFILE)
18BUILD_DIR = $(OUTDIR)
19
20PREFIX = arm-none-eabi-
21CC =$(PREFIX)gcc
22AS = $(PREFIX)gcc -x assembler-with-cpp
23CP = $(PREFIX)objcopy
24SZ = $(PREFIX)size
25
26HEX = $(CP) -O ihex
27BIN = $(CP) -O binary -S
28
29####################################
30all:
31	@echo "Create $(BUILD_DIR)/$(TARGET).elf"
32	cp -f ${ELF_FILE} $(BUILD_DIR)/$(TARGET).elf
33	$(SZ) $(BUILD_DIR)/$(TARGET).elf
34	@echo "Create $(BUILD_DIR)/$(TARGET).hex"
35	rm -rf $(BUILD_DIR)/$(TARGET).hex
36	$(HEX) $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex
37	@echo "Create $(BUILD_DIR)/$(TARGET).bin"
38	rm -rf $(BUILD_DIR)/$(TARGET).bin
39	$(BIN) $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).bin
40	md5sum $(BUILD_DIR)/$(TARGET)*