# Makefile for MinGW (64 bit) # 2021-03-20 CC = gcc AR = ar INSTALL = install CFLAGS = -Wall -O2 PREFIX = /mingw64/local BINDIR = $(PREFIX)/bin INCDIR = $(PREFIX)/include LIBDIR = $(PREFIX)/lib LIBMAJOR=7 LIBMINOR=2 LIBPOINT=0 LIBVER=5.2.1 STATICLIB = libgif.a SHAREDLIB = libgif.dll IMPLIB = libgif.dll.a SOURCES = dgif_lib.c egif_lib.c gifalloc.c gif_err.c gif_font.c \ gif_hash.c openbsd-reallocarray.c HEADERS = gif_hash.h gif_lib.h gif_lib_private.h OBJECTS = $(SOURCES:.c=.o) LDLIBS=libgif.a -lm all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) $(STATICLIB): $(OBJECTS) $(AR) $(ARFLAGS) $@ $(OBJECTS) $(IMPLIB): $(SHAREDLIB) $(SHAREDLIB): $(OBJECTS) $(CC) -Wl,--out-implib,$(IMPLIB) -o libgif.dll \ -shared $(OBJECTS) -Wl,--subsystem,windows clean: rm -f $(STATICLIB) $(SHAREDLIB) $(IMPLIB) *.o install: all install-bin install-include install-lib install-bin: $(INSTALL) -d "$(DESTDIR)$(BINDIR)" $(INSTALL) -m 755 $(SHAREDLIB) "$(DESTDIR)$(BINDIR)" install-include: $(INSTALL) -d "$(DESTDIR)$(INCDIR)" $(INSTALL) -m 644 gif_lib.h "$(DESTDIR)$(INCDIR)" install-lib: $(INSTALL) -d "$(DESTDIR)$(LIBDIR)" $(INSTALL) -m 644 $(STATICLIB) "$(DESTDIR)$(LIBDIR)" $(INSTALL) -m 644 $(IMPLIB) "$(DESTDIR)$(LIBDIR)" uninstall: uninstall-include uninstall-lib uninstall-bin uninstall-bin: rm -f "$(DESTDIR)$(BINDIR)/$(SHAREDLIB)" uninstall-include: rm -f "$(DESTDIR)$(INCDIR)/gif_lib.h" uninstall-lib: rm -f "$(DESTDIR)$(LIBDIR)/$(STATICLIB)" rm -f "$(DESTDIR)$(LIBDIR)/$(IMPLIB)"