xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | # Makefile for PngMinus (png2pnm and pnm2png) |
| 2 | # Linux / Unix |
| 3 | |
| 4 | #CC = cc |
| 5 | CC = gcc |
| 6 | LD = $(CC) |
| 7 | |
| 8 | RM = rm -f |
| 9 | |
| 10 | PNGINC = -I../.. |
| 11 | PNGLIB_SHARED = -L../.. -lpng |
| 12 | PNGLIB_STATIC = ../../libpng.a |
| 13 | |
| 14 | # Uncomment the following if you have a custom zlib build at ../../../zlib |
| 15 | #ZINC = -I../../../zlib |
| 16 | #ZLIB_SHARED = -L../../../zlib -lz |
| 17 | #ZLIB_STATIC = ../../../zlib/libz.a |
| 18 | |
| 19 | # Use the system zlib otherwise |
| 20 | ZLIB_SHARED = -lz |
| 21 | ZLIB_STATIC = -lz |
| 22 | |
| 23 | CPPFLAGS = $(PNGINC) $(ZINC) |
| 24 | CFLAGS = |
| 25 | LDFLAGS = |
| 26 | LIBS_SHARED = $(PNGLIB_SHARED) $(ZLIB_SHARED) |
| 27 | LIBS_STATIC = $(PNGLIB_STATIC) $(ZLIB_STATIC) |
| 28 | |
| 29 | EXEEXT = |
| 30 | #EXEEXT = .exe |
| 31 | |
| 32 | # dependencies |
| 33 | |
| 34 | all: png2pnm$(EXEEXT) pnm2png$(EXEEXT) png2pnm-static$(EXEEXT) pnm2png-static$(EXEEXT) |
| 35 | |
| 36 | png2pnm.o: png2pnm.c |
| 37 | $(CC) -c $(CPPFLAGS) $(CFLAGS) png2pnm.c |
| 38 | |
| 39 | pnm2png.o: pnm2png.c |
| 40 | $(CC) -c $(CPPFLAGS) $(CFLAGS) pnm2png.c |
| 41 | |
| 42 | png2pnm$(EXEEXT): png2pnm.o |
| 43 | $(LD) $(LDFLAGS) -o png2pnm$(EXEEXT) png2pnm.o $(LIBS_SHARED) -lm |
| 44 | |
| 45 | pnm2png$(EXEEXT): pnm2png.o |
| 46 | $(LD) $(LDFLAGS) -o pnm2png$(EXEEXT) pnm2png.o $(LIBS_SHARED) -lm |
| 47 | |
| 48 | png2pnm-static$(EXEEXT): png2pnm.o |
| 49 | $(LD) $(LDFLAGS) -o png2pnm-static$(EXEEXT) png2pnm.o $(LIBS_STATIC) -lm |
| 50 | |
| 51 | pnm2png-static$(EXEEXT): pnm2png.o |
| 52 | $(LD) $(LDFLAGS) -o pnm2png-static$(EXEEXT) pnm2png.o $(LIBS_STATIC) -lm |
| 53 | |
| 54 | clean: |
| 55 | $(RM) png2pnm.o |
| 56 | $(RM) pnm2png.o |
| 57 | $(RM) png2pnm$(EXEEXT) |
| 58 | $(RM) pnm2png$(EXEEXT) |
| 59 | $(RM) png2pnm-static$(EXEEXT) |
| 60 | $(RM) pnm2png-static$(EXEEXT) |
| 61 | |
| 62 | # End of makefile for png2pnm / pnm2png |