mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
build: Update the makefiles for the benefit of cross-compilation
Split AR_RC into AR and ARFLAGS. The variables AR and ARFLAGS are de-facto standards (like CC and CFLAGS, LD and LDFLAGS, etc.) that may be overridden when running make. Moreover, configuring CC, LD, AR, etc., to point to a cross-platform compiler, linker, librarian, etc., is a de-facto standard practice as well. Also remove the MKDIR_P variable definitions from all makefiles. They've been leftovers from the removal of the "install*" targets.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# makefile for libpng using gcc (generic, static library)
|
||||
# Copyright (C) 2000, 2022 Cosmin Truta
|
||||
# Copyright (C) 2000, 2020-2024 Cosmin Truta
|
||||
# Copyright (C) 2002, 2006-2009, 2014 Glenn Randers-Pehrson
|
||||
# Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc)
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
@@ -15,9 +15,8 @@ ZLIBLIB = ../zlib
|
||||
# Compiler, linker, lib and other tools
|
||||
CC = gcc
|
||||
LD = $(CC)
|
||||
AR_RC = ar rcs
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
MKDIR_P = mkdir -p
|
||||
RM_F = rm -f
|
||||
|
||||
LIBNAME = libpng16
|
||||
@@ -26,6 +25,7 @@ PNGMAJ = 16
|
||||
WARNMORE =
|
||||
CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
|
||||
CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
|
||||
ARFLAGS = rc
|
||||
LDFLAGS = -L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
|
||||
|
||||
# File lists
|
||||
@@ -44,7 +44,7 @@ REMOVE = $(RM_F)
|
||||
DFNFLAGS = $(DEFS) $(CPPFLAGS)
|
||||
|
||||
$(LIBNAME).a: $(OBJS)
|
||||
$(AR_RC) $@ $(OBJS)
|
||||
$(AR) $(ARFLAGS) $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
test: pngtest
|
||||
|
||||
Reference in New Issue
Block a user