SHELL = /bin/sh

.SUFFIXES:

CC = gcc -O
CFLAGS = -g -Wall
tmp := $(shell pkg-config gtk+-2.0 --cflags)
CCFLAGS := -Wall \
-D_POSIX2 \
$(tmp)

all: cpt4 do_hart
#----------------------------------------------------------------------------
cpt4_OBJECTS = cpt4.o cpt4help.o cpt4pmsg.o cpt4qmsg.o cpt4about.o
cpt4: $(cpt4_OBJECTS)
	$(CC) $(cpt4_OBJECTS) `pkg-config gtk+-2.0 --libs` -o cpt4 
	
cpt4.o: cpt4.c cpt4qmsg.h
	$(CC) $(CCFLAGS) -c cpt4.c -o cpt4.o
cpt4help.o: cpt4help.c cpt4help.h
	$(CC) $(CCFLAGS) -c cpt4help.c -o cpt4help.o
cpt4pmsg.o: cpt4pmsg.c
	$(CC) $(CCFLAGS) -c cpt4pmsg.c -o cpt4pmsg.o
cpt4qmsg.o: cpt4qmsg.c cpt4qmsg.h
	$(CC) $(CCFLAGS) -c cpt4qmsg.c -o cpt4qmsg.o
cpt4about.o: cpt4about.c cpt4about.h
	$(CC) $(CCFLAGS) -c cpt4about.c -o cpt4about.o

cpt4help.h: makegtxt cpt4help.txt
	./makegtxt cpt4help.txt cpt4help.h helptext
cpt4about.h: makegtxt cpt4about.txt
	./makegtxt cpt4about.txt cpt4about.h abouttext

#----------------------------------------------------------------------------
do_hart_OBJECTS = do_hart.o
do_hart: $(do_hart_OBJECTS)
	$(CC) $(do_hart_OBJECTS) -o do_hart 
	
do_hart.o: do_hart.c decipher.h
	$(CC) $(CCFLAGS) -c do_hart.c -o do_hart.o
decipher.h: makecdct decipher.dct
	./makecdct decipher.dct decipher.h decipher

#------------------------------------------------------------
makegtxt: makegtxt.c
	$(CC) $(CFLAGS) makegtxt.c  -o makegtxt
#------------------------------------------------------------
makecdct: makecdct.c
	$(CC) $(CFLAGS) makecdct.c  -o makecdct

#----------------------------------        
# DO NOT DELETE
