# # Makefile for mingw environment (native win32 no cygwin dll # dependencies). Requires mingw gcc release >= 2.95.2-1 and of # course a version of make. # ########################################################################### # # User variables, change for your local system # # comment out for no debugging DEBUGGING_ON = 1 # Put the path to where your gtk libraries are kept GTK_PATH = c:/mingw ################## Try not to edit ############################ CC = gcc CXX = g++ DEBUG = -g -Wall CXXFLAGS = ifdef DEBUGGING_ON CFLAGS = $(DEBUG) -O2 -mwindows -mms-bitfields -mcpu=pentium else CFLAGS = -O2 -mwindows -fexpensive-optimizations -ffast-math\ -mms-bitfields -mcpu=pentium endif CPPFLAGS = -I. DLL_CFLAGS = -DHAVE_CONFIG_H -I .. exeext = .exe # # Various targets to build. # DLL_NAME = libgtkextra.dll DLL_EXP_LIB = libgtkextra.dll.a DLL_EXP_DEF = gtkextra.def LIBA=libgtkextra.a TESTAPPS = testgtksheet testgtkiconlist testgtkfilesel testgtkplot \ testbubbles testgtkfont testrealtime testgtkplot3d \ testcontour testpolar testflux testboxes testimage TESTEXE = $(TESTAPPS:=.exe) TESTOBJ = $(TESTAPPS:=.o) # # sources, objects, etc. # SRCS = \ gtkbordercombo.c \ gtkcharsel.c \ gtkcheckitem.c \ gtkcolorcombo.c \ gtkcombobox.c \ gtkdirtree.c \ gtkextra.c \ gtkfilelist.c \ gtkfontcombo.c \ gtkiconlist.c \ gtkitementry.c \ gtkiconfilesel.c \ gtkplot.c \ gtkplot3d.c \ gtkplotbubble.c \ gtkplotdt.c \ gtkplotarray.c \ gtkplotpolar.c \ gtkplotdata.c \ gtkplotpixmap.c \ gtkplotbar.c \ gtkplotbox.c \ gtkplotcandle.c \ gtkplotflux.c \ gtkplotsegment.c \ gtkplotsurface.c \ gtkplotcsurface.c \ gtkplotcanvas.c \ gtkplotpc.c \ gtkplotgdk.c \ gtkplotps.c \ gtkplotprint.c \ gtkpsfont.c \ gtksheet.c \ gtktogglecombo.c \ gtkplotcanvasline.c \ gtkplotcanvasrectangle.c \ gtkplotcanvasellipse.c \ gtkplotcanvastext.c \ gtkplotcanvaspixmap.c \ gtkplotcanvasplot.c # $(wildcard *.cc *.c) OBJS = $(SRCS:.cc=.o) OBJS := $(OBJS:.c=.o) # # DLL related variables. These are used when building the DLL. See later. # # INC= -I . -I $(GTK_PATH)/include/glib-2.0\ -I $(GTK_PATH)/include/glib-2.0/gmodule \ -I $(GTK_PATH)/lib/glib-2.0/include \ -I $(GTK_PATH)/lib/gtk+/include \ -I .. LIB = -L . -L $(GTK_PATH)/lib/ \ -L $(GTK_PATH)/lib/glib-2.0 \ -L $(GTK_PATH)/lib/glib-2.0/gmodule DLL_CFLAGS = # The default entry point defined by dllwrap; the default user callback # is DllMain DLL_LDFLAGS = # any extra libraries that your DLL may depend on. DLL_LDLIBS = -L $(GTK_PATH)/lib -lgtk-0 -lgdk-0 \ -lglib-2.0 \ -lgmodule-2.0 \ -lm -luser32 -ladvapi32 -lwsock32 DLL_SRCS = $(SRCS) DLL_OBJS = $(DLL_SRCS:.cc=.o) DLL_OBJS := $(DLL_OBJS:.c=.o) all: config $(LIBA) $(DLL_NAME) tests static:$(LIBA) dll:$(DLL_NAME) config: $(shell copy ..\config.h.win32 ..\config.h) $(LIBA):$(DLL_OBJS) ar rc $@ $^ # # Build the dll using the shared switch # $(DLL_NAME): $(CC) --shared $(DLL_OBJS) $(DLL_LDFLAGS) $(DLL_LDLIBS) \ -o $@ -Wl,--out-implib,$(DLL_EXP_LIB) # # Here we build the test executeables # tests:\ testgtkplotcanvas testiterator testsegment testcandles testdt testgtkplotdt \ testboxes testflux testgtkplot testpixmap \ testbubbles testgtkfilesel testgtkplot3d testpolar \ testcharsel testgtkfont testgtksheet testrealtime \ testcontour testgtkiconlist testimage testgtkplotcanvas: testgtkplotcanvas.o $(CC) $(INC) $(LIB) testgtkplotcanvas.o -o $@ -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testiterator: testiterator.o $(CC) $(INC) $(LIB) testiterator.o -o $@ -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testsegment: testsegment.o $(CC) $(INC) $(LIB) testsegment.o -o $@ -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testcandles: testcandles.o $(CC) $(INC) $(LIB) testcandles.o -o $@ -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testdt: testdt.o $(CC) $(INC) $(LIB) testdt.o -o $@ -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testgtkplotdt: testgtkplotdt.o $(CC) $(INC) $(LIB) testgtkplotdt.o -o $@ -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testgtkfilesel: testgtkfilesel.o $(CC) $(INC) $(LIB) testgtkfilesel.o -o $@ -lm \ -lgtkextra -lgdk-0 -lgtk-0 -lgmodule-2.0 \ -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testgtkplot: testgtkplot.o $(CC) $(INC) $(LIB) testgtkplot.o -o $@ -lm \ -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testboxes: testboxes.o $(CC) $(INC) $(LIB) testboxes.o -o $@ -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testflux: testflux.o $(CC) $(INC) $(LIB) testflux.o -o $@ -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testbubbles: testbubbles.o $(CC) $(INC) $(LIB) testbubbles.o -o $@ -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testpolar: testpolar.o $(CC) $(INC) $(LIB) testpolar.o -o $@ -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testcontour: testcontour.o $(CC) $(INC) $(LIB) testcontour.o -o $@ -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testgtkplot3d: testgtkplot3d.o $(CC) $(INC) $(LIB) testgtkplot3d.o -o $@ -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testgtksheet: testgtksheet.o $(CC) $(INC) $(LIB) -o $@ testgtksheet.o -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testgtkfont: testgtkfont.o $(CC) $(INC) $(LIB) testgtkfont.o -o $@ -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testrealtime: testrealtime.o $(CC) $(INC) $(LIB) -o $@ testrealtime.o -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testgtkiconlist: testgtkiconlist.o $(CC) $(INC) $(LIB) -o $@ testgtkiconlist.o -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testpixmap: testpixmap.o $(CC) $(INC) $(LIB) -o $@ testpixmap.o -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testcharsel: testcharsel.o $(CC) $(INC) $(LIB) -o $@ testcharsel.o -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 testimage: testimage.o $(CC) $(INC) $(LIB) -o $@ testimage.o -lm -lgtkextra -lgdk-0 \ -lgtk-0 -lgmodule-2.0 -lglib-2.0 -luser32 -ladvapi32 -lwsock32 # # default rules for building DLL objects. Note that client programs (ie., # the ones that *use* the DLL) have to be compiled without the DLL_CFLAGS # flags. # .cc.o: $(CXX) -c $(DLL_CFLAGS) $(CPPFLAGS) $(CXXFLAGS) -o $@ $< .c.o: $(CC) -c $(DLL_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(INC) -o $@ $< clean: -rm -f $(OBJS) $(DLL_NAME) $(DLL_EXP_LIB) $(LIBA) \ $(TESTEXE) $(TESTOBJ)