###
### This file is part of
###
###                        TurboLinux  ZWinPro
###
###                 Copyright (C) 1999 TurboLinux, Inc. 
###                        All Rights Reserved
### Distributed under the terms of the GNU General Public License (GPL)
###
###
### Authors:     TurboLinux Chinese Development Team:
###              Justin Yu   <justiny@turbolinux.com.cn>
###              Sean Chen   <seanc@turbolinux.com.cn>
###              Daniel Fang <danf@turbolinux.com.cn>
### WWW:         http://www.turbolinux.com.cn/ZWinPro/
### FTP:         ftp://ftp.turbolinux.com.cn/pub/ZWinPro/
###

CFLAGS = # -DZWINPRO
XLIB = -L/usr/X11R6/lib -lX11 -lXext -lgdk_imlib -ljpeg -lpng -ltiff -lungif -lz -lm
GCC = gcc $(CFLAGS) -DVERSION=\"3.0\"
OBJS = toolbar.o config.o logo.o help.o tips.o file.o dialog.o convert.o manage.o

all:
	make zwincontrol
	cd text; make all

zwincontrol: $(OBJS)
	gcc -o zwincontrol $(OBJS) `gtk-config --libs` $(XLIB)

toolbar.o: toolbar.c defs.h hzclient.h
	$(GCC) -Wall -c `gtk-config --cflags` -o toolbar.o toolbar.c 

config.o: config.c defs.h hzclient.h
	$(GCC) -Wall -c `gtk-config --cflags` -o config.o config.c 

logo.o: logo.c
	$(GCC) -Wall -c `gtk-config --cflags` -o logo.o logo.c 

help.o: help.c
	$(GCC) -Wall -c `gtk-config --cflags` -o help.o help.c 

tips.o: tips.c
	$(GCC) -Wall -c `gtk-config --cflags` -o tips.o tips.c 

file.o: file.c
	$(GCC) -Wall -c `gtk-config --cflags` -o file.o file.c 

dialog.o: dialog.c
	$(GCC) -Wall -c `gtk-config --cflags` -o dialog.o dialog.c 

convert.o: convert.c
	$(GCC) -Wall -c `gtk-config --cflags` -o convert.o convert.c 

manage.o: manage.c
	$(GCC) -Wall -c `gtk-config --cflags` -o manage.o manage.c 

install: all
	strip zwincontrol
	cp -f zwincontrol /usr/bin
	mkdir -p /usr/lib/ZWinPro
	mkdir -p /usr/share/locale/zh_CN/LC_MESSAGES
	mkdir -p /usr/share/locale/zh_TW.Big5/LC_MESSAGES
	cp -f text/zwincontrol_gb.mo /usr/share/locale/zh_CN/LC_MESSAGES/zwincontrol.mo
	cp -f text/zwincontrol_big5.mo /usr/share/locale/zh_TW.Big5/LC_MESSAGES/zwincontrol.mo

clean:
	rm -f zwincontrol *.o *.bak *~
	cd text; make clean
