SYSTEM=$(shell uname) SUBSYSTEM=$(shell uname | cut -f 1 -d_ ) ifeq ($(SYSTEM),Darwin) CC = i386-mingw32-gcc CXX = i386-mingw32-g++ LD = i386-mingw32-g++ STRIP = i386-mingw32-strip --strip-unneeded AR = i386-mingw32-ar rcs else ifeq ($(SUBSYSTEM),MINGW32) CC = gcc CXX = g++ LD = g++ strip = strip --strip-unneeded AR = ar rcs else DISTRIB=$(shell cat /etc/issue | cut -f 1 -d\ | head -1) ifeq ($(DISTRIB), CentOS) CC = i686-pc-mingw32-gcc CXX = i686-pc-mingw32-g++ LD = i686-pc-mingw32-g++ STRIP = i686-pc-mingw32-strip --strip-unneeded AR = i686-pc-mingw32-ar rcs else CC = i686-w64-mingw32-gcc CXX = i686-w64-mingw32-g++ LD = i686-w64-mingw32-g++ STRIP = i686-w64-mingw32-strip --strip-unneeded AR = i686-w64-mingw32-ar rcs endif endif endif INCLUDES = \ -I../Baltisot/include \ -I../LuaJIT/src \ -I ../freetype-win32/include/freetype2 \ -I ../gnuwin32/include \ -I ../pthreads-w32-2-8-0-release/ \ -I im/include -I cd/include -I cd/src/sim -I cd/src/x11 -I iup/include -I iup/src -I iup/srccontrols \ HAVES = -DHAVE_VSSCANF -DHAVE_LIBJPEG -DHAVE_MALLOC_H -DHAVE_BYTESWAP_H -DCD_NO_OLD_INTERFACE -DGTK_DISABLE_DEPRECATED -DIUPLUA_USELOH -DUSE_STATIC -D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x0500 -DWINVER=0x0501 -DIUP_DLL CPPFLAGS += $(INCLUDES) -g -DSTDC_HEADERS -DREADLINE_STATIC -DHOOK_STDS -DWORDS_LITTLEENDIAN -fexceptions -march=i686 $(HAVES) -D__CRT_INLINE="static inline" -DNDEBUG #-DUSE_MGL_NAMESPACE LDFLAGS += -g -fexceptions -shared ../lua-interface/lua-interface.a -Wl,--export-dynamic -Wl,--enable-auto-image-base -Wl,--export-all-symbols -Wl,--enable-auto-import \ -L ../freetype-win32/lib -L ../gnuwin32/lib vpath %.c ../Baltisot/lib:../Baltisot/src:src:im/src:im/src/process:im/src/lua5:cd/src:cd/src/intcgm:cd/src/drv:cd/src/sim:cd/src/win32:cd/src/lua5:iup/src:iup/src/win:iup/src/gtk:iup/srccd:iup/srccontrols:iup/srccontrols/color:iup/srccontrols/matrix:iup/srcim:iup/srclua5:cd/src/svg vpath %.cc ../Baltisot/lib:../Baltisot/src:src:im/src:im/src/process:im/src/lua5:cd/src:cd/src/intcgm:cd/src/drv:cd/src/sim:cd/src/win32:cd/src/lua5:iup/src:iup/src/win:iup/src/gtk:iup/srccd:iup/srccontrols:iup/srccontrols/color:iup/srccontrols/matrix:iup/srcim:iup/srclua5:cd/src/svg vpath %.cpp ../Baltisot/lib:../Baltisot/src:src:im/src:im/src/process:im/src/lua5:cd/src:cd/src/intcgm:cd/src/drv:cd/src/sim:cd/src/win32:cd/src/lua5:iup/src:iup/src/win:iup/src/gtk:iup/srccd:iup/srccontrols:iup/srccontrols/color:iup/srccontrols/matrix:iup/srcim:iup/srclua5:cd/src/svg vpath %.lua ../Baltisot/lib:../Baltisot/src IM_SOURCES = \ im_converttype.cpp \ im_attrib.cpp \ im_format.cpp \ im_format_tga.cpp \ im_filebuffer.cpp \ im_bin.cpp \ im_format_all.cpp \ im_format_raw.cpp \ im_binfile.cpp \ im_format_sgi.cpp \ im_datatype.cpp \ im_format_pcx.cpp \ im_colorhsi.cpp \ im_format_bmp.cpp \ im_image.cpp \ im_rgb2map.cpp \ im_colormode.cpp \ im_format_gif.cpp \ im_lib.cpp \ im_format_pnm.cpp \ im_colorutil.cpp \ im_format_ico.cpp \ im_palette.cpp \ im_convertbitmap.cpp \ im_format_led.cpp \ im_counter.cpp \ im_str.cpp \ im_convertcolor.cpp \ im_fileraw.cpp \ im_format_krn.cpp \ im_file.cpp \ im_format_ras.cpp \ im_arithmetic_bin.cpp \ im_morphology_gray.cpp \ im_quantize.cpp \ im_arithmetic_un.cpp \ im_geometric.cpp \ im_render.cpp \ im_color.cpp \ im_histogram.cpp \ im_resize.cpp \ im_convolve.cpp \ im_houghline.cpp \ im_statistics.cpp \ im_convolve_rank.cpp \ im_logic.cpp \ im_threshold.cpp \ im_effects.cpp \ im_morphology_bin.cpp \ im_tonegamut.cpp \ im_canny.cpp \ im_distance.cpp \ im_analyze.cpp \ im_kernel.cpp \ im_sysfile_win32.cpp \ imlua.c \ imlua_aux.c \ imlua_convert.c \ imlua_file.c \ imlua_image.c \ imlua_palette.c \ imlua_util.c \ imlua_process.c \ imlua_kernel.c \ IM_LIBS = CD_SOURCES = \ cd.c \ wd.c \ wdhdcpy.c \ rgb2map.c \ cd_vectortext.c \ cd_active.c \ cd_attributes.c \ cd_bitmap.c \ cd_image.c \ cd_primitives.c \ cd_text.c \ cd_util.c \ circle.c \ ellipse.c \ intcgm1.c \ intcgm2.c \ intcgm4.c \ intcgm6.c \ list.c \ sism.c \ tparse.c \ bparse.c \ cddgn.c \ cdcgm.c \ cgm.c \ cddxf.c \ cdirgb.c \ cdmf.c \ cdps.c \ cdpicture.c \ cddebug.c \ cdfontex.c \ sim.c \ sim_primitives.c \ sim_linepolyfill.c \ cd0prn.c \ cd0emf.c \ cd0wmf.c \ cdlua5.c \ cdvoid5.c \ cdlua5ctx.c \ cdlua5_active.c \ cdlua5_canvas.c \ cdluacontextplus5.c \ cdluaim5.c \ cdwclp.c \ cdwdbuf.c \ cdwdib.c \ cdwemf.c \ cdwimg.c \ cdwin.c \ cdwin.h \ cdwnative.c \ cdwprn.c \ cdwwmf.c \ wmf_emf.c \ base64.c \ cdsvg.c \ lodepng.c \ CD_LIBS = -lgdi32 -lcomdlg32 IUP_SOURCES = \ iup_array.c \ iup_callback.c \ iup_dlglist.c \ iup_attrib.c \ iup_focus.c \ iup_font.c \ iup_globalattrib.c \ iup_object.c \ iup_key.c \ iup_layout.c \ iup_ledlex.c \ iup_names.c \ iup_open.c \ iup_ledparse.c \ iup_predial.c \ iup_register.c \ iup_scanf.c \ iup_show.c \ iup_str.c \ iup_table.c \ iup_func.c \ iup_childtree.c \ iup.c \ iup_classattrib.c \ iup_dialog.c \ iup_assert.c \ iup_canvas.c \ iup_messagedlg.c \ iup_timer.c \ iup_image.c \ iup_label.c \ iup_fill.c \ iup_zbox.c \ iup_colordlg.c \ iup_fontdlg.c \ iup_filedlg.c \ iup_strmessage.c \ iup_menu.c \ iup_frame.c \ iup_user.c \ iup_button.c \ iup_radio.c \ iup_toggle.c \ iup_progressbar.c \ iup_text.c \ iup_val.c \ iup_box.c \ iup_hbox.c \ iup_vbox.c \ iup_cbox.c \ iup_class.c \ iup_classbase.c \ iup_maskmatch.c \ iup_mask.c \ iup_maskparse.c \ iup_tabs.c \ iup_spin.c \ iup_list.c \ iup_getparam.c \ iup_sbox.c \ iup_normalizer.c \ iup_tree.c \ iup_split.c \ iupwin_brush.c \ iupwin_button.c \ iupwin_canvas.c \ iupwin_clipboard.c \ iupwin_colordlg.c \ iupwin_common.c \ iupwin_dialog.c \ iupwindows_help.c \ iupwindows_info.c \ iupwindows_main.c \ iupwin_draw.c \ iupwin_filedlg.c \ iupwin_focus.c \ iupwin_font.c \ iupwin_fontdlg.c \ iupwin_frame.c \ iupwin_globalattrib.c \ iupwin_handle.c \ iupwin_image.c \ iupwin_info.c \ iupwin_key.c \ iupwin_label.c \ iupwin_list.c \ iupwin_loop.c \ iupwin_menu.c \ iupwin_messagedlg.c \ iupwin_open.c \ iupwin_progressbar.c \ iupwin_tabs.c \ iupwin_text.c \ iupwin_timer.c \ iupwin_tips.c \ iupwin_toggle.c \ iupwin_tree.c \ iupwin_val.c \ iup_oldmask.c \ iup_array.c \ iup_callback.c \ iup_dlglist.c \ iup_attrib.c \ iup_focus.c \ iup_font.c \ iup_globalattrib.c \ iup_object.c \ iup_key.c \ iup_layout.c \ iup_ledlex.c \ iup_names.c \ iup_open.c \ iup_ledparse.c \ iup_predial.c \ iup_register.c \ iup_scanf.c \ iup_show.c \ iup_str.c \ iup_table.c \ iup_func.c \ iup_childtree.c \ iup.c \ iup_classattrib.c \ iup_dialog.c \ iup_assert.c \ iup_canvas.c \ iup_messagedlg.c \ iup_timer.c \ iup_image.c \ iup_label.c \ iup_fill.c \ iup_zbox.c \ iup_colordlg.c \ iup_fontdlg.c \ iup_filedlg.c \ iup_strmessage.c \ iup_menu.c \ iup_frame.c \ iup_user.c \ iup_button.c \ iup_radio.c \ iup_toggle.c \ iup_progressbar.c \ iup_text.c \ iup_val.c \ iup_box.c \ iup_hbox.c \ iup_vbox.c \ iup_cbox.c \ iup_class.c \ iup_classbase.c \ iup_maskmatch.c \ iup_mask.c \ iup_maskparse.c \ iup_tabs.c \ iup_spin.c \ iup_list.c \ iup_getparam.c \ iup_sbox.c \ iup_normalizer.c \ iup_tree.c \ iup_cd.c \ iup_cdutil.c \ iup_gauge.c \ iup_cells.c \ iup_colorbar.c \ iup_controls.c \ iup_dial.c \ iup_colorbrowser.c \ iup_colorhsi.c \ iup_colorbrowserdlg.c \ iupmat_key.c \ iupmat_mark.c \ iupmat_aux.c \ iupmat_mem.c \ iupmat_mouse.c \ iupmat_numlc.c \ iupmat_colres.c \ iupmat_draw.c \ iupmat_focus.c \ iupmat_getset.c \ iupmatrix.c \ iupmat_scroll.c \ iupmat_edit.c \ iup_im.c \ iuplua.c \ iuplua_api.c \ il_tree_aux.c \ il_scanf.c \ il_getparam.c \ il_getcolor.c \ il_button.c \ il_canvas.c \ il_dialog.c \ il_colordlg.c \ il_clipboard.c \ il_filedlg.c \ il_fill.c \ il_frame.c \ il_hbox.c \ il_normalizer.c \ il_item.c \ il_image.c \ il_imagergb.c \ il_imagergba.c \ il_label.c \ il_menu.c \ il_multiline.c \ il_list.c \ il_separator.c \ il_user.c \ il_submenu.c \ il_text.c \ il_toggle.c \ il_vbox.c \ il_zbox.c \ il_timer.c \ il_sbox.c \ il_spin.c \ il_spinbox.c \ il_cbox.c \ il_messagedlg.c \ il_radio.c \ il_val.c \ il_tabs.c \ il_fontdlg.c \ il_tree.c \ il_progressbar.c \ il_split.c \ iuplua_cd.c \ iuplua_controls.c \ il_mask.c \ il_matrix_aux.c \ il_dial.c \ il_gauge.c \ il_colorbrowser.c \ il_colorbar.c \ il_matrix.c \ il_cells.c \ iuplua_im.c \ IUP_LIBS = -lole32 -lcomctl32 MAIN_IUP_SOURCE = \ plugin-luaiup.cc \ WHOLE_SOURCES = \ $(IM_SOURCES) \ $(CD_SOURCES) \ $(IUP_SOURCES) \ $(MAIN_IUP_SOURCE) \ MODULES_LIST = \ luaiup.dll \ ALL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(WHOLE_SOURCES)))) ALL_DEPS = $(addsuffix .dep, $(notdir $(basename $(WHOLE_SOURCES)))) all: dep modules modules: $(MODULES_LIST) dep: $(ALL_DEPS) luaiup.a: $(addsuffix .o, $(notdir $(basename $(IM_SOURCES) $(CD_SOURCES) $(IUP_SOURCES)))) $(AR) $@ $+ luaiup.dll: plugin-luaiup.o luaiup.a $(LD) -o $@ $+ $(IM_LIBS) $(CD_LIBS) $(IUP_LIBS) $(LDFLAGS) clean: rm -f *.o *.dep *.dll %.dep : %.c $(CC) $(CPPFLAGS) -M -MF $@ $< %.dep : %.cpp $(CXX) $(CPPFLAGS) -M -MF $@ $< %.dep : %.cc $(CXX) $(CPPFLAGS) -M -MF $@ $< %.c : %.lua bin2c $< $@ $(basename $@) -include $(ALL_DEPS)