1 | # makefile for libpng using clang (generic, static library)
|
---|
2 | # Copyright (C) 2000, 2014, 2019-2022 Cosmin Truta
|
---|
3 | # Copyright (C) 2008, 2014 Glenn Randers-Pehrson
|
---|
4 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
---|
5 | #
|
---|
6 | # This code is released under the libpng license.
|
---|
7 | # For conditions of distribution and use, see the disclaimer
|
---|
8 | # and license in png.h
|
---|
9 |
|
---|
10 | # Location of the zlib library and include files
|
---|
11 | ZLIBINC = ../zlib
|
---|
12 | ZLIBLIB = ../zlib
|
---|
13 |
|
---|
14 | # Compiler, linker, lib and other tools
|
---|
15 | CC = clang
|
---|
16 | LD = $(CC)
|
---|
17 | AR_RC = ar rcs
|
---|
18 | RANLIB = ranlib
|
---|
19 | CP = cp
|
---|
20 | RM_F = rm -f
|
---|
21 |
|
---|
22 | # Compiler and linker flags
|
---|
23 | NOHWOPT = -DPNG_ARM_NEON_OPT=0 -DPNG_MIPS_MSA_OPT=0 \
|
---|
24 | -DPNG_POWERPC_VSX_OPT=0 -DPNG_INTEL_SSE_OPT=0
|
---|
25 | WARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \
|
---|
26 | -Wmissing-declarations -Wtraditional -Wcast-align \
|
---|
27 | -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
|
---|
28 | DEFS = $(NOHWOPT)
|
---|
29 | CPPFLAGS = -I$(ZLIBINC) $(DEFS) # -DPNG_DEBUG=5
|
---|
30 | CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
|
---|
31 | LDFLAGS = -L$(ZLIBLIB) # -g
|
---|
32 | LIBS = -lz -lm
|
---|
33 |
|
---|
34 | # File extensions
|
---|
35 | EXEEXT =
|
---|
36 |
|
---|
37 | # Pre-built configuration
|
---|
38 | # See scripts/pnglibconf.mak for more options
|
---|
39 | PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
|
---|
40 |
|
---|
41 | # File lists
|
---|
42 | OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
|
---|
43 | pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
|
---|
44 | pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
|
---|
45 |
|
---|
46 | # Targets
|
---|
47 | all: static
|
---|
48 |
|
---|
49 | pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
|
---|
50 | $(CP) $(PNGLIBCONF_H_PREBUILT) $@
|
---|
51 |
|
---|
52 | .c.o:
|
---|
53 | $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
---|
54 |
|
---|
55 | static: libpng.a pngtest$(EXEEXT)
|
---|
56 |
|
---|
57 | shared:
|
---|
58 | @echo This is a generic makefile that cannot create shared libraries.
|
---|
59 | @echo Please use a configuration that is specific to your platform.
|
---|
60 | @false
|
---|
61 |
|
---|
62 | libpng.a: $(OBJS)
|
---|
63 | $(AR_RC) $@ $(OBJS)
|
---|
64 | $(RANLIB) $@
|
---|
65 |
|
---|
66 | test: pngtest$(EXEEXT)
|
---|
67 | ./pngtest$(EXEEXT)
|
---|
68 |
|
---|
69 | pngtest$(EXEEXT): pngtest.o libpng.a
|
---|
70 | $(LD) $(LDFLAGS) -o $@ pngtest.o libpng.a $(LIBS)
|
---|
71 |
|
---|
72 | clean:
|
---|
73 | $(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h
|
---|
74 |
|
---|
75 | png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
76 | pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
77 | pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
78 | pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
79 | pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
80 | pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
81 | pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
82 | pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
83 | pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
84 | pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
85 | pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
86 | pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
87 | pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
88 | pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
89 | pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
90 |
|
---|
91 | pngtest.o: png.h pngconf.h pnglibconf.h
|
---|