Added the ability to compile both GTK versions 1 and 2 at the same time.

svn path=/trunk/; revision=9827
This commit is contained in:
Ulf Lamping 2004-01-24 20:01:36 +00:00
parent 6e59f95ceb
commit 064d5e5e07
3 changed files with 71 additions and 40 deletions

View File

@ -1,7 +1,7 @@
## Makefile for building ethereal.exe with Microsoft C and nmake
## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
#
# $Id: Makefile.nmake,v 1.396 2004/01/21 21:46:59 jmayer Exp $
# $Id: Makefile.nmake,v 1.397 2004/01/24 20:01:35 ulfl Exp $
include config.nmake
include <win32.mak>
@ -13,7 +13,7 @@ LINK= link
LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
CFLAGS=-DHAVE_CONFIG_H $(LOCAL_CFLAGS) $(GTK_CFLAGS) /I. /Iwiretap \
CFLAGS=-DHAVE_CONFIG_H $(LOCAL_CFLAGS) $(GLIB_CFLAGS) /I. /Iwiretap \
$(ZLIB_CFLAGS) /I$(PCAP_DIR)\include \
/I$(NET_SNMP_DIR)\include /I$(NET_SNMP_DIR)\win32 \
$(ADNS_CFLAGS) $(PCRE_CFLAGS) -D_U_=""
@ -127,10 +127,9 @@ EXTRA_OBJECTS = \
strptime.obj
ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
gtk\libui.lib epan\ethereal.lib \
epan\ethereal.lib \
epan\dfilter\dfilter.lib epan\ftypes\ftypes.lib \
wsock32.lib user32.lib \
$(GTK_LIBS) \
$(ADNS_LIBS) \
$(PCRE_LIBS) \
$(NET_SNMP_DIR)\win32\lib\netsnmp.lib
@ -164,21 +163,35 @@ randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
$(GLIB_LIBS) \
$(NET_SNMP_DIR)\win32\lib\netsnmp.lib
EXECUTABLES=ethereal.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
EXECUTABLES=ethereal.exe ethereal2.exe tethereal.exe editcap.exe mergecap.exe text2pcap.exe
RESOURCES=image\ethereal.res image\tethereal.res image\editcap.res image\mergecap.res image\text2pcap.res
all: tools wiretap gtk epan image $(EXECUTABLES) $(RESOURCES) doc
all: tools wiretap epan image $(EXECUTABLES) $(RESOURCES) doc
$(RESOURCES): image
wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
!IFNDEF GTK1_DIR
ethereal.exe :
!ELSE
ethereal.exe : config.h cvsversion.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
@echo Linking $@
$(LINK) @<<
/OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
/OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(GTK1_LIBS) gtk\libui.lib $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
<<
!ENDIF
!IFNDEF GTK2_DIR
ethereal2.exe :
!ELSE
ethereal2.exe : config.h cvsversion.h $(ethereal_OBJECTS) $(EXTRA_OBJECTS) epan gtk2 image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk2.tmp\libui.lib plugins
@echo Linking $@
$(LINK) @<<
/OUT:ethereal2.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(GTK2_LIBS) gtk2.tmp\libui.lib $(ethereal_OBJECTS) $(EXTRA_OBJECTS) image\ethereal.res
<<
!ENDIF
tethereal.exe : config.h cvsversion.h $(tethereal_OBJECTS) $(EXTRA_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
@echo Linking $@
@ -321,7 +334,11 @@ tethereal-tap-register.c: $(TETHEREAL_TAP_SRC) make-tapreg-dotc
text2pcap-scanner.c : text2pcap-scanner.l
$(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
clean:
gtk2_distclean:
rm -f gtk2.tmp/*.*
if exist gtk2.tmp rmdir gtk2.tmp
clean: gtk2_distclean
rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
$(EXECUTABLES) $(PDB_FILE) \
editcap.obj mergecap.obj text2pcap.obj \
@ -351,7 +368,7 @@ clean:
# Call distclean only, if you would like to remove ALL generated files.
# Be sure to have python and perl installed to regenerate them.
distclean: clean
distclean: clean gtk2_distclean
rm -f $(BUILT_SOURCES) \
packet-ncp2222.c register.c tethereal-tap-register.c
cd wiretap
@ -391,7 +408,16 @@ wiretap::
gtk:: help config.h cvsversion.h
cd gtk
$(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
$(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK1_CFLAGS)" GTK_LIBS="$(GTK1_LIBS)" libui.lib
cd ..
# copy all required files to gtk2.tmp (but only when newer than existing) and compile in that dir
gtk2::
if not exist gtk2.tmp mkdir gtk2.tmp
cd gtk
cp --update --preserve Makefile.* *.c *.h ..\gtk2.tmp
cd ..\gtk2.tmp
$(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK2_CFLAGS)" GTK_LIBS="$(GTK2_LIBS)" libui.lib
cd ..
epan::

View File

@ -1,4 +1,4 @@
# $Id: config.nmake,v 1.77 2004/01/23 02:38:03 gerald Exp $
# $Id: config.nmake,v 1.78 2004/01/24 20:01:35 ulfl Exp $
VERSION=0.10.0
#
@ -45,18 +45,16 @@ GLIB_DIR=$(ETHEREAL_LIBS)\glib
# put header files in an "include\gtk-{version}" directory and libraries
# in a "lib\gtk-{version}" directory.
#
# If you're building with GTK+ 1.3, set GTK_VERSION to 1.3 and set
# GTK_DIR to the pathname of the "gtk+" directory; if you're building
# with GTK+ 2.x, set GTK_VERSION to 2.0 and set GTK_DIR to the pathname
# of the directory in which the "include" and "lib" directories reside.
# It's possible, to build both GTK version 1 and 2 at the same time,
# or only one of the versions. GTK version 1 is currently recommended.
#
# If you want building with GTK+ 1.3, set GTK1_DIR to the pathname of the
# "gtk+" directory; if you want building with GTK+ 2.x, set GTK2_DIR to
# the pathname of the directory in which the "include" and "lib" directories
# reside.
#
GTK_VERSION=1.3
#GTK_VERSION=2.0
!IF "$(GTK_VERSION)" == "1.3"
GTK_DIR=$(ETHEREAL_LIBS)\gtk+
!ELSE
GTK_DIR=$(ETHEREAL_LIBS)\gtk2
!ENDIF
GTK1_DIR=$(ETHEREAL_LIBS)\gtk+
#GTK2_DIR=$(ETHEREAL_LIBS)\gtk2
#
# If you have Zlib, set this to the pathname of the directory in
@ -168,25 +166,26 @@ GLIB_LIBS=$(GLIB_DIR)\lib\glib-$(GLIB_VERSION).lib \
$(GLIB_DIR)\lib\gmodule-$(GLIB_VERSION).lib \
$(GLIB_DIR)\lib\gobject-$(GLIB_VERSION).lib
!IF "$(GTK_VERSION)" == "1.3"
# GTK+ 1.3
GTK_CFLAGS=$(GLIB_CFLAGS) /I$(GTK_DIR)\include /I$(GTK_DIR)\include\gdk \
/I$(GTK_DIR)\lib\gtk+\include
GTK_LIBS=$(GTK_DIR)\lib\gtk.lib \
$(GTK_DIR)\lib\gdk.lib \
GTK1_VERSION=1.3
GTK1_CFLAGS=$(GLIB_CFLAGS) /I$(GTK1_DIR)\include /I$(GTK1_DIR)\include\gdk \
/I$(GTK1_DIR)\lib\gtk+\include
GTK1_LIBS=$(GTK1_DIR)\lib\gtk.lib \
$(GTK1_DIR)\lib\gdk.lib \
$(GLIB_LIBS)
!ELSE
# GTK+ 2.x
GTK_CFLAGS=$(GLIB_CFLAGS) /I$(GTK_DIR)\include\gtk-$(GTK_VERSION) \
/I$(GTK_DIR)\lib\gtk-$(GTK_VERSION)\include \
/I$(GTK_DIR)\include\atk-1.0 \
/I$(GTK_DIR)\include\pango-1.0
GTK_LIBS=$(GTK_DIR)\lib\gtk-win32-$(GTK_VERSION).lib \
$(GTK_DIR)\lib\gdk-win32-$(GTK_VERSION).lib \
$(GTK_DIR)\lib\gdk_pixbuf-$(GTK_VERSION).lib \
$(GTK_DIR)\lib\pango-1.0.lib \
GTK2_VERSION=2.0
GTK2_CFLAGS=$(GLIB_CFLAGS) /I$(GTK2_DIR)\include\gtk-$(GTK2_VERSION) \
/I$(GTK2_DIR)\lib\gtk-$(GTK2_VERSION)\include \
/I$(GTK2_DIR)\include\atk-1.0 \
/I$(GTK2_DIR)\include\pango-1.0
GTK2_LIBS=$(GTK2_DIR)\lib\gtk-win32-$(GTK2_VERSION).lib \
$(GTK2_DIR)\lib\gdk-win32-$(GTK2_VERSION).lib \
$(GTK2_DIR)\lib\gdk_pixbuf-$(GTK2_VERSION).lib \
$(GTK2_DIR)\lib\pango-1.0.lib \
$(GLIB_LIBS)
!ENDIF
!IFDEF WINPCAP_VERSION
# Nmake uses carets to escape special characters

View File

@ -1,19 +1,25 @@
#
# $Id: Makefile.nmake,v 1.4 2003/11/06 09:05:11 guy Exp $
# $Id: Makefile.nmake,v 1.5 2004/01/24 20:01:36 ulfl Exp $
#
include ..\..\config.nmake
############### no need to modify below this line #########
CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GTK_CFLAGS) \
# XXX: that's odd here, no GTK stuff should be in the plugins dir,
# so move all GTK specific stuff into gtk dir.
# As GTK1_CFLAGS isn't correct here, we don't have GTK_CFLAGS
# any longer, so no better choice here. If the move of GTK code
# finished, replace this with GLIB_CFLAGS.
# The same applies to GTK1_LIBS -> GLIB_LIBS.
CFLAGS=/DHAVE_CONFIG_H /I../.. /I../../wiretap $(GTK1_CFLAGS) \
/I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS)
OBJECTS=packet-asn1.obj
asn1.dll asn1.exp asn1.lib : $(OBJECTS) ..\plugin_api.obj
link -dll /out:asn1.dll $(OBJECTS) ..\plugin_api.obj \
$(GTK_LIBS)
$(GTK1_LIBS)
clean:
rm -f $(OBJECTS) asn1.dll asn1.exp asn1.lib $(PDB_FILE)