# OpenSolaris makefile for FreeImage. # Go through the following steps before # you run this Makefile. # 1. prepend your PATH environment variable # with /usr/gnu/bin (to get GNU Make). # 2. run pfexec pkg install SUNWgmake # to install gmake. # 3. run pfexec pkg install SUNWgnu-coreutils # to install GNU coreutils. # Note you do not have to use the 'pfexec' prefix in 2 # and 3 above if you're running as root. include Makefile.srcs # General configuration variables: CC = gcc CPP = g++ AR = ar INSTALL = /usr/bin/ginstall INSTALLDIR = /usr # Converts cr/lf to just lf DOS2UNIX = dos2unix COMPILERFLAGS = -O3 LIBRARIES = -lstdc++ MODULES = $(SRCS:.c=.o) MODULES := $(MODULES:.cpp=.o) CFLAGS = $(COMPILERFLAGS) $(INCLUDE) CPPFLAGS = $(COMPILERFLAGS) -Wno-ctor-dtor-privacy $(INCLUDE) TARGET = freeimage STATICLIB = lib$(TARGET).a SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so LIBNAME = lib$(TARGET).so.$(VER_MAJOR) default: all all: dist dist: FreeImage cp *.a Dist cp *.so Dist cp Source/FreeImage.h Dist dos2unix: @$(DOS2UNIX) $(SRCS) $(INCLS) FreeImage: $(STATICLIB) $(SHAREDLIB) .c.o: $(CC) $(CFLAGS) -c $< -o $@ .cpp.o: $(CPP) $(CPPFLAGS) -c $< -o $@ $(STATICLIB): $(MODULES) $(AR) r $@ $(MODULES) $(SHAREDLIB): $(MODULES) $(CC) -s -G -Wl,-soname=$(LIBNAME) -o $@ $(MODULES) $(LIBRARIES) install: $(INSTALL) -m 644 -o root -g root Source/FreeImage.h $(INSTALLDIR)/include $(INSTALL) -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)/lib $(INSTALL) -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)/lib ln -sf $(SHAREDLIB) $(INSTALLDIR)/lib/$(LIBNAME) clean: rm -rf core Dist/*.* u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME)