#
# $Id: Makefile,v 1.2 2003/02/01 19:21:22 mulix Exp $
#

GCC:=		gcc
GXX:=		g++
LD := 		${GXX}

INCLUDES= 	-I.. 
CFLAGS= 	-g -Wall -Wstrict-prototypes -Werror $(INCLUDES) \
		`libglade-config --cflags gtk` -DGTKSCT_DEBUG
CXXFLAGS= 	-g -Wall -Wstrict-prototypes -Werror $(INCLUDES) \
		`libglade-config --cflags gtk` -DGTKSCT_DEBUG
LDFLAGS= 	

OBJS =  	main.o gtksct.o
PROG = 		gtksct
RM = 		/bin/rm -f

SCTLIBS =	../sct_parselib/libsct_parselib.a ../sct_rules/libsct_rules.a \
		../sct_ctrl_lib/libsct_ctrl.a

SCTLIBSLINK =	-L../sct_parselib -lsct_parselib -L../sct_rules -lsct_rules \
		-L../sct_ctrl_lib -lsct_ctrl

LIBSLINK =	$(SCTLIBSLINK) `libglade-config --libs gtk`

all: $(PROG)

# linking rule remains the same as before.
$(PROG): $(OBJS) $(SCTLIBS)
	$(LD) $(OBJS) $(LDFLAGS) -o $(PROG) $(LIBSLINK)

# now comes a meta-rule for compiling any "C" source file.
%.o: %.c
	$(GXX) $(CFLAGS) $(DFLAGS) -c $<

# now comes a meta-rule for compiling any "C++" source file.
%.o: %.cpp
	$(GXX) $(CXXFLAGS) -c $<

clean:
	@echo "cleaning files '$(OBJS)' '$(PROG_OBJS) $(LIB) $(PROG)'"
	@$(RM) $(OBJS) $(PROG_OBJS) $(LIB) $(PROG)
