#-----------------------------------------------------------------
#
#	The infamous    *LIBTTHIMAGE*       20 juin 2022
#
#-----------------------------------------------------------------

include ../Paramakes.mk

DEPS = ../tthimage.h ../Paramakes.mk Makefile

all:	foo testtga

#-----------------------------------------------------------------

7seg.o:		7seg.c		$(DEPS)

alpha.o:	alpha.c		$(DEPS)
alpha2.o:	alpha2.c	$(DEPS)

basic_io.o:	basic_io.c	$(DEPS)
bitblt.o:	bitblt.c	$(DEPS)
bmp.o:		bmp.c		$(DEPS)		bmp.h

cadres.o:	cadres.c	$(DEPS)
cadres2.o:	cadres2.c	$(DEPS)
cadres3.o:	cadres3.c	$(DEPS)
cadres4.o:	cadres4.c	$(DEPS)
cadres84.o:	cadres84.c	$(DEPS)
cadresbox.o:	cadresbox.c	$(DEPS)

calcluts.o:	calcluts.c	$(DEPS)	
calculs.o:	calculs.c	$(DEPS)
classif.o:	classif.c	$(DEPS)
col4bits.o:	col4bits.c	$(DEPS)
col_reduc.o:	col_reduc.c	$(DEPS)
col_xyz.o:	col_xyz.c	$(DEPS)
colors.o:	colors.c	$(DEPS)
colors2.o:	colors2.c	$(DEPS)
combine.o:	combine.c	$(DEPS)
combine2.o:	combine2.c	$(DEPS)
combine3.o:	combine3.c	$(DEPS)
combine4.o:	combine4.c	$(DEPS)
combine5.o:	combine5.c	$(DEPS)
combine6.o:	combine6.c	$(DEPS)
contrast.o:	contrast.c	$(DEPS)

detect.o:	detect.c	$(DEPS)
distances.o:	distances.c	$(DEPS)
dither.o:	dither.c	$(DEPS)
dither2.o:	dither2.c	$(DEPS)
dither3.o:	dither3.c	$(DEPS)
dither4.o:	dither4.c	$(DEPS)
doublesz.o:	doublesz.c	$(DEPS)
drawalpha.o:	drawalpha.c	$(DEPS)
drawing.o:	drawing.c	$(DEPS)
drawpatt.o:	drawpatt.c	$(DEPS)

effects.o:	effects.c	$(DEPS)
effects2.o:	effects2.c	$(DEPS)
effects3.o:	effects3.c	$(DEPS)
extractbits.o:	extractbits.c	$(DEPS)

filtadapt.o:	filtadapt.c	$(DEPS)
filtres.o:	filtres.c	$(DEPS)

gadgrect.o:	gadgrect.c	$(DEPS)
glitch.o:	glitch.c	$(DEPS)

halfsize.o:	halfsize.c	$(DEPS)

image.o:    	image.c		$(DEPS)
imprime.o:	imprime.c	$(DEPS)

luts15bits.o:	luts15bits.c	$(DEPS)

marques.o:	marques.c	$(DEPS)
mircol.o:	mircol.c	$(DEPS)
morpho.o:	morpho.c	$(DEPS)
mosaic.o:	mosaic.c	$(DEPS)
msglib.o:	msglib.c	$(DEPS)
mustopen.o:	mustopen.c	$(DEPS)

operat.o:	operat.c	$(DEPS)
op2x2.o:	op2x2.c		$(DEPS)

palettes.o:	palettes.c	$(DEPS)
patterns.o:	patterns.c	$(DEPS)
patterns2.o:	patterns2.c	$(DEPS)
patterns3.o:	patterns3.c	$(DEPS)
patterns4.o:	patterns4.c	$(DEPS)
photomaton.o:	photomaton.c	$(DEPS)
pht.o:		pht.c		$(DEPS)
pixeliz.o:	pixeliz.c	$(DEPS)
pixels.o:	pixels.c	$(DEPS)
plotteur.o:	plotteur.c	$(DEPS)
png.o:		png.c		$(DEPS)
pnm.o:		pnm.c		$(DEPS)
pov_hf15a.o:	pov_hf15a.c	$(DEPS)
pov_hf15b.o:	pov_hf15b.c	$(DEPS)
pov_hf15c.o:	pov_hf15c.c	$(DEPS)
pov_hf15d.o:	pov_hf15d.c	$(DEPS)
pov_hf15e.o:	pov_hf15e.c	$(DEPS)
pov_hf15f.o:	pov_hf15f.c	$(DEPS)
pov_synth.o:	pov_synth.c	$(DEPS)
ptlist.o:	ptlist.c	$(DEPS)

recurse.o:	recurse.c	$(DEPS)
rgbmask.o:	rgbmask.c	$(DEPS)

scale.o:	scale.c		$(DEPS)
sobel4.o:	sobel4.c	$(DEPS)
stereo.o:	stereo.c	$(DEPS)

tamppool.o:	tamppool.c	$(DEPS)
tele_2.o:	tele_2.c	$(DEPS)
television.o:	television.c	$(DEPS)
text0.o:	text0.c		$(DEPS)
text1.o:	text1.c		$(DEPS)
text16x24.o:	text16x24.c	$(DEPS)
tga.o:		tga.c		$(DEPS)
tools.o:	tools.c		$(DEPS)

vignetize.o:	vignetize.c	$(DEPS)

warp0.o:	warp0.c		$(DEPS)
warp1.o:	warp1.c		$(DEPS)
warp2.o:	warp2.c		$(DEPS)
warp3.o:	warp3.c		$(DEPS)

zoom.o:		zoom.c		$(DEPS)

#-----------------------------------------------------------------

OBJECTS =	7seg.o							\
		alpha.o alpha2.o					\
		basic_io.o bitblt.o bmp.o				\
		cadres2.o cadres3.o cadres4.o cadres84.o cadresbox.o	\
		cadres.o						\
		calculs.o classif.o 					\
		col4bits.o colors.o colors2.o col_reduc.o col_xyz.o	\
		combine.o combine2.o combine3.o combine4.o combine5.o 	\
		combine6.o combine_rnd.o				\
		contrast.o						\
		detect.o distances.o					\
		dither.o dither2.o dither3.o dither4.o			\
		doublesz.o drawalpha.o drawing.o drawpatt.o		\
		effects.o effects2.o effects3.o extractbits.o		\
		filtadapt.o filtres.o					\
		gadgrect.o glitch.o					\
		halfsize.o						\
		image.o	imprime.o					\
		luts15bits.o						\
		marques.o mircol.o morpho.o mosaic.o msglib.o		\
		mustopen.o						\
		operat.o op2x2.o					\
		palettes.o						\
		patterns.o patterns2.o patterns3.o patterns4.o		\
		photomaton.o pht.o pixeliz.o pixels.o plotteur.o	\
		pnm.o png.o						\
		pov_hf15a.o pov_hf15b.o pov_hf15c.o pov_hf15d.o 	\
		pov_hf15e.o pov_hf15e.o pov_hf15f.o pov_synth.o		\
		ptlist.o						\
		recurse.o rgbmask.o					\
		scale.o	sobel4.o stereo.o				\
		tamppool.o tele_2.o television.o			\
		text0.o text1.o text16x24.o				\
		tga.o tools.o						\
		vignetize.o						\
		warp0.o warp1.o warp2.o warp3.o				\
		zoom.o

../libtthimage.a: 	$(OBJECTS)
	$(AR) 	vrs $@ $?
	$(RANLIB)   $@

#-----------------------------------------------------------------

foo:		foo.c $(DEPS) ../libtthimage.a
	gcc $(CFLAGS) $< ../libtthimage.a -o $@

t_t16x24:	t_t16x24.c $(DEPS)  ../libtthimage.a
	gcc $(CFLAGS) $< ../libtthimage.a -o $@

t_png:	t_png.c $(DEPS)  ../libtthimage.a
	gcc $(CFLAGS) $< ../libtthimage.a -lpng -lz -o $@

testbmp:	testbmp.c $(DEPS)  ../libtthimage.a
	gcc $(CFLAGS) $< ../libtthimage.a -lm -o $@


#-----------------------------------------------------------------

essais.o:	essais.c	$(DEPS) essais.h
	gcc $(CFLAGS) $< -c

testtga:	testtga.c $(DEPS) ../libtthimage.a essais.o
	gcc $(CFLAGS) $< essais.o ../libtthimage.a -lm -o $@

#-----------------------------------------------------------------