###
# File:           Makefile - GNU makefile, predpoklada se g++
# Date:           2009-02-02 21:03:11 
# Project:        Separable image resampling
# Author:         Bronislav Pribyl  xpriby12@stud.fit.vutbr.cz
# Encoding:       utf-8
# Version:        1.5
###


#compiler selection
CC=gcc
CPPC=g++

RM=rm -f

#compiler flags
CFLAGS=-std=c99 -pedantic -Wall -W -g3
CPPFLAGS=-std=c++98 -Wall -W -g3

#DigILib relative path
DGLBDIR=digilib

#output binary name
RESAMPLING=resampling

#files to pack
TARBALL=Makefile resampling.c FIR.h FIR.c squares.h squares.c bit-handling.h bit-handling.c $(DGLBDIR)/* demo/*




all: $(RESAMPLING)


$(RESAMPLING): resampling.o FIR.o squares.o bit-handling.o $(DGLBDIR)/DigILib.so
	$(CC) $(CFLAGS) -o resampling resampling.o FIR.o squares.o bit-handling.o -I. $(DGLBDIR)/DigILib.so -lm


resampling.o: resampling.c FIR.h squares.h $(DGLBDIR)/DigILib.so $(DGLBDIR)/Image.h $(DGLBDIR)/ImageFil.h $(DGLBDIR)/LibEntry.h
	$(CC) $(CFLAGS) -o resampling.o -c resampling.c -I. $(DGLBDIR)/DigILib.so

FIR.o: FIR.c FIR.h
	$(CC) $(CFLAGS) -o FIR.o -c FIR.c

squares.o: squares.c squares.h bit-handling.o
	$(CC) $(CFLAGS) -o squares.o -c squares.c

bit-handling.o: bit-handling.c bit-handling.h FIR.h
	$(CC) $(CFLAGS) -o bit-handling.o -c bit-handling.c



run: all
	./$(RESAMPLING)


clear: clean
clean:
	$(RM) $(RESAMPLING)
	$(RM) *.o
	$(RM) $(DGLBDIR)/*.o
	$(RM) *~
	$(RM) $(DGLBDIR)/*~
	$(RM) demo/*~
	$(RM) resampling.zip


re: remake
remake: clean all


pack: $(TARBALL) readme.txt
	zip resampling.zip $(TARBALL) readme.txt

# end of file Makefile

