| # Sample makefile for pngcrush using gcc and make. |
| # Glenn Randers-Pehrson |
| # Last modified: 7 December 1999 |
| # |
| # Invoke this makefile from a shell prompt in the usual way; for example: |
| # |
| # make -f makefile.unx |
| # |
| # This makefile builds a statically linked executable. |
| |
| # macros -------------------------------------------------------------------- |
| |
| CC = gcc |
| LD = gcc |
| RM = rm -f |
| CFLAGS = -O -Wall |
| # [note that -Wall is a gcc-specific compilation flag ("all warnings on")] |
| LDFLAGS = |
| O = .o |
| E = |
| |
| PNGCRUSH = pngcrush |
| |
| LIBS = -lm |
| |
| OBJS = $(PNGCRUSH)$(O) adler32$(O) crc32$(O) deflate$(O) gzio$(O) \ |
| infblock$(O) infcodes$(O) inffast$(O) inflate$(O) inftrees$(O) \ |
| infutil$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ |
| pngpread$(O) pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \ |
| pngset$(O) pngtrans$(O) pngvcrd$(O) pngwio$(O) pngwrite$(O) \ |
| pngwtran$(O) pngwutil$(O) trees$(O) zutil$(O) |
| |
| EXES = $(PNGCRUSH)$(E) |
| |
| |
| # implicit make rules ------------------------------------------------------- |
| |
| .c$(O): png.h pngconf.h zlib.h pngcrush.h |
| $(CC) -c $(CFLAGS) $< |
| |
| |
| # dependencies -------------------------------------------------------------- |
| |
| all: $(EXES) |
| |
| |
| $(PNGCRUSH)$(E): $(OBJS) |
| $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) |
| |
| $(PNGCRUSH)$(O): $(PNGCRUSH).c png.h pngconf.h zlib.h pngcrush.h |
| |
| # maintenance --------------------------------------------------------------- |
| |
| clean: |
| $(RM) $(EXES) $(OBJS) |