https://doi.org/10.5201/ipol.2011.g_iics
Raw File
Tip revision: 2f369309d6656c6bbbe0c0533385c5838cd165bc authored by Software Heritage on 01 January 2010, 00:00:00 UTC
ipol: Deposit 692 in collection ipol
Tip revision: 2f36930
makefile.gcc
# GCC makefile for cwinterp, Contour stencil windowed interpolation demo
# Pascal Getreuer 
# April 20, 2011

## 
# The following three statements determine the build configuration.
# For handling different image formats, the program can be linked with
# the libjpeg, libpng, and libtiff libraries.  For each library, set
# the flags needed for linking.  To disable use of a library, comment
# its statement.  You can disable all three (BMP is always supported).
LDLIBJPEG=-ljpeg
LDLIBPNG=-lpng
LDLIBTIFF=-ltiff

##
# Standard make settings
SHELL=/bin/sh
CFLAGS=-O2 -ansi -pedantic
LDFLAGS=-lm $(LDLIBJPEG) $(LDLIBPNG) $(LDLIBTIFF)

## 
# These statements add compiler flags to define LIBJPEG_SUPPORT, etc.,
# depending on which libraries have been specified above.
ifneq ($(LDLIBJPEG),)
	CJPEG=-DLIBJPEG_SUPPORT
endif
ifneq ($(LDLIBPNG),)
	CPNG=-DLIBPNG_SUPPORT
endif
ifneq ($(LDLIBTIFF),)
	CTIFF=-DLIBTIFF_SUPPORT
endif

ALLCFLAGS=$(CFLAGS) $(CJPEG) $(CPNG) $(CTIFF)

CWINTERP_SOURCES=cwinterpcli.c cwinterp.c nninterp.c drawline.c fitsten.c imageio.c invmat.c basic.c
IMCOARSEN_SOURCES=imcoarsen.c imageio.c basic.c
IMDIFF_SOURCES=imdiff.c conv.c imageio.c basic.c
NNINTERP_SOURCES=nninterpcli.c nninterp.c imageio.c basic.c
SOURCES=basic.c basic.h conv.c conv.h cwinterp.c cwinterp.h cwinterpcli.c drawline.c \
drawline.h fitsten.c fitsten.h imageio.c imageio.h imcoarsen.c imdiff.c invmat.c invmat.h \
nninterp.c nninterp.h nninterpcli.c readme.html bsd-license.txt \
makefile.gcc makefile.vc doxygen.conf demo demo.bat frog-hr.bmp
CWINTERP_OBJECTS=$(CWINTERP_SOURCES:.c=.o)
IMCOARSEN_OBJECTS=$(IMCOARSEN_SOURCES:.c=.o)
IMDIFF_OBJECTS=$(IMDIFF_SOURCES:.c=.o)
NNINTERP_OBJECTS=$(NNINTERP_SOURCES:.c=.o)
.SUFFIXES: .c .o

.PHONY: all
all: cwinterp imcoarsen imdiff nninterp

cwinterp: $(CWINTERP_OBJECTS)
	$(CC) $(CWINTERP_OBJECTS) -o $@ $(LDFLAGS)

imcoarsen: $(IMCOARSEN_OBJECTS)
	$(CC) $(IMCOARSEN_OBJECTS) -o $@ $(LDFLAGS)

imdiff: $(IMDIFF_OBJECTS)
	$(CC) $(IMDIFF_OBJECTS) -o $@ $(LDFLAGS)

nninterp: $(NNINTERP_OBJECTS)
	$(CC) $(NNINTERP_OBJECTS) -o $@ $(LDFLAGS)

.c.o:
	$(CC) -c $(ALLCFLAGS) $< -o $@

.PHONY: clean
clean:
	-$(RM) $(CWINTERP_OBJECTS) $(IMCOARSEN_OBJECTS) $(IMDIFF_OBJECTS) $(NNINTERP_OBJECTS) cwinterp imcoarsen imdiff nninterp

.PHONY: rebuild
rebuild: clean all

# Source documentation with Doxygen
.PHONY: srcdoc
srcdoc: $(SOURCES)
	doxygen doxygen.conf

.PHONY: dist
dist: $(SOURCES)
	echo cwinterp-src > .fname
	-rm -rf `cat .fname`
	mkdir `cat .fname`
	ln $(SOURCES) `cat .fname`
	tar chzf `cat .fname`.tar.gz `cat .fname`
	-rm -rf `cat .fname` .fname

.PHONY: dist-zip
dist-zip: $(SOURCES)
	echo cwinterp-src > .fname
	-rm -rf `cat .fname`
	mkdir `cat .fname`
	ln $(SOURCES) `cat .fname`
	-rm `cat .fname`.zip
	zip -9 `cat .fname`.zip `cat .fname`/*
	-rm -rf `cat .fname` .fname
back to top