mirror of
http://180.163.74.83:13000/zhangzhenghao/write_mac_tool.git
synced 2025-12-12 15:04:28 +00:00
39 lines
1.1 KiB
Makefile
39 lines
1.1 KiB
Makefile
# Makefile for update_mac.c with ARM (aarch64) cross-compile, matching dev_gaiban compile.sh
|
|
# Usage:
|
|
# make # default: build arm64
|
|
# make arm64 # build aarch64 binary using compile.sh toolchain
|
|
# make native # build native x86_64 binary (for local test)
|
|
# make toolchain # show cross compiler info
|
|
# make clean # remove binaries
|
|
|
|
SHELL := /bin/bash
|
|
|
|
COMPILE_SH ?= /home/hyx/work/dev_gaiban/APP_AP05_1.1.22_tuxi_shengchan/compile.sh
|
|
SRC := update_mac.c
|
|
TARGET_ARM64 := update_mac_pdd
|
|
TARGET_NATIVE := update_mac
|
|
|
|
# Allow overriding CFLAGS via environment
|
|
CFLAGS ?= -O2 -Wall -I/home/hyx/work/pdd_shengchan/hiredis
|
|
LDFLAGS ?= -lpthread /home/hyx/work/pdd_shengchan/hiredis/libhiredis.a
|
|
|
|
.PHONY: all arm64 native clean toolchain
|
|
|
|
all: arm64
|
|
|
|
arm64: $(TARGET_ARM64)
|
|
|
|
$(TARGET_ARM64): $(SRC)
|
|
. $(COMPILE_SH) && $${CC} $(CFLAGS) -o $@ $< $(LDFLAGS)
|
|
|
|
native: $(TARGET_NATIVE)
|
|
|
|
$(TARGET_NATIVE): $(SRC)
|
|
gcc $(CFLAGS) -o $@ $< $(LDFLAGS)
|
|
|
|
# Show the configured cross toolchain
|
|
toolchain:
|
|
. $(COMPILE_SH) && echo "Using CC=$${CC}" && $${CC} -v || true
|
|
|
|
clean:
|
|
rm -f $(TARGET_ARM64) $(TARGET_NATIVE)
|