CC=gcc
CCFLAGS= -g -D__unix__ -D__linux__
LDFLAGS=-lm

# Objects and headers for each of the texture compression tools

DECODE_OBJS = commonpb.o decomppb.o fximgpb.o
DECODE_HDRS = 3dfxpb.h comppb.h fximgpb.h fxt1gpl.h

ENCODE_OBJS = commonpb.o encomppb.o fximgpb.o
ENCODE_HDRS = 3dfxpb.h comppb.h fximgpb.h fxt1gpl.h

ISUB_OBJS = Isubpb.o fximgpb.o
ISUB_HDRS = 3dfxpb.h fximgpb.h fxt1gpl.h


# How do I build an object 
%.o : %.c
	$(CC) $(CCFLAGS) -c $< -o $@


all: decode encode isub

# The real targets
decode: $(DECODE_OBJS)
	$(CC) $(CCFLAGS) -o decode $(DECODE_OBJS) 

encode: $(ENCODE_OBJS)
	$(CC) $(CCFLAGS) -o encode $(ENCODE_OBJS) $(LDFLAGS)

isub: 	$(ISUB_OBJS)
	$(CC) $(CCFLAGS) -o isub $(ISUB_OBJS) $(LDFLAGS)

clean:
	rm -f *.o
	rm -f decode encode isub
	rm -f *~
