2025-11-06 02:32:18 +00:00
|
|
|
# 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
|
2025-12-08 03:37:42 +00:00
|
|
|
SRC := update_mac_pdd.c
|
|
|
|
|
TARGET_ARM64 := update_mac_pdd
|
|
|
|
|
TARGET_NATIVE := update_mac_pdd_native
|
2025-11-06 02:32:18 +00:00
|
|
|
|
|
|
|
|
# Allow overriding CFLAGS via environment
|
2025-11-10 07:36:49 +00:00
|
|
|
CFLAGS ?= -O2 -Wall -I/home/hyx/work/write_mac_tool/hiredis
|
|
|
|
|
LDFLAGS ?= -lpthread /home/hyx/work/write_mac_tool/hiredis/libhiredis.a
|
2025-11-06 02:32:18 +00:00
|
|
|
|
|
|
|
|
.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)
|