--- x86_64-w64-mingw32/src/Makefile.orig	2014-12-16 01:25:46.470600000 +0300
+++ x86_64-w64-mingw32/src/Makefile	2014-12-16 06:59:47.119800000 +0300
@@ -3,7 +3,7 @@
 # Generated by qmake (2.01a) (Qt 4.8.6) on: Mo. Sep 15 22:00:30 2014
 # Project:  src.pro
 # Template: lib
-# Command: /usr/lib/x86_64-linux-gnu/qt4/bin/qmake -o Makefile src.pro
+# Command: qmake -o Makefile src.pro
 #############################################################################
 
 ####### Compiler, tools and options
@@ -11,15 +11,15 @@
 CC            = gcc
 CXX           = g++
 DEFINES       = 
-CFLAGS        = -pipe -O2 -Wall -W -fPIC $(DEFINES)
-CXXFLAGS      = -pipe -O2 -Wall -W -fPIC $(DEFINES)
-INCPATH       = -I. -I../include -I.. -I/usr/X11R6/include
+CFLAGS        = -pipe -O2 -Wall -W $(DEFINES)
+CXXFLAGS      = -pipe -O2 -Wall -W $(DEFINES)
+INCPATH       = -I. -I../include -I..
 LINK          = g++
-LFLAGS        = -Wl,-O1 -shared -Wl,-soname,libopencsg.so.1
-LIBS          = $(SUBLIBS)  -L/usr/X11R6/lib64 -lGLEW -lGL 
+LFLAGS        = -Wl,-O1 -shared -Wl,--out-implib,../lib/$(TARGETI)
+LIBS          = $(SUBLIBS) -lglu32 -lopengl32 -lgdi32 -luser32 -lglew32 
 AR            = ar cqs
 RANLIB        = 
-QMAKE         = /usr/lib/x86_64-linux-gnu/qt4/bin/qmake
+QMAKE         = qmake
 TAR           = tar -cf
 COMPRESS      = gzip -9f
 COPY          = cp -f
@@ -37,6 +37,12 @@
 CHK_DIR_EXISTS= test -d
 MKDIR         = mkdir -p
 
+####### Install directories
+
+prefix ?= /usr/local/
+bindir = $(prefix)/bin
+includedir = $(prefix)/include
+libdir = $(prefix)/lib
 ####### Output directory
 
 OBJECTS_DIR   = ./
@@ -82,12 +88,9 @@
 DIST          = src.pro
 QMAKE_TARGET  = opencsg
 DESTDIR       = ../lib/
-TARGET        = libopencsg.so.1.4.2
-TARGETA       = ../lib/libopencsg.a
-TARGETD       = libopencsg.so.1.4.2
-TARGET0       = libopencsg.so
-TARGET1       = libopencsg.so.1
-TARGET2       = libopencsg.so.1.4
+TARGET        = libopencsg-1.dll
+TARGETA       = libopencsg.a
+TARGETI       = libopencsg.dll.a
 
 first: all
 ####### Implicit rules
@@ -111,28 +114,29 @@
 
 ####### Build rules
 
-all: Makefile  ../lib/$(TARGET)
+all: shared staticlib
+
+shared: ../lib/$(TARGET)
 
 ../lib/$(TARGET):  $(OBJECTS) $(SUBLIBS) $(OBJCOMP)  
 	@$(CHK_DIR_EXISTS) ../lib/ || $(MKDIR) ../lib/ 
-	-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)
+	@$(CHK_DIR_EXISTS) ../bin/ || $(MKDIR) ../bin/ 
+	-$(DEL_FILE) ../bin/$(TARGET)
+	-$(DEL_FILE) ../lib/$(TARGETI)
 	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP)
-	-ln -s $(TARGET) $(TARGET0)
-	-ln -s $(TARGET) $(TARGET1)
-	-ln -s $(TARGET) $(TARGET2)
-	-$(DEL_FILE) ../lib/$(TARGET)
-	-$(DEL_FILE) ../lib/$(TARGET0)
-	-$(DEL_FILE) ../lib/$(TARGET1)
-	-$(DEL_FILE) ../lib/$(TARGET2)
-	-$(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) ../lib/
+	-$(DEL_FILE) ../bin/$(TARGET)
+	-$(MOVE) $(TARGET) ../bin/
 
 
+staticlib: ../lib/$(TARGETA)
 
-staticlib: $(TARGETA)
-
-$(TARGETA):  $(OBJECTS) $(OBJCOMP) 
+../lib/$(TARGETA): $(OBJECTS) $(OBJCOMP)
+	@$(CHK_DIR_EXISTS) ../lib/ || $(MKDIR) ../lib/ 
+	-$(DEL_FILE) ../lib/$(TARGETA)
 	-$(DEL_FILE) $(TARGETA) 
 	$(AR) $(TARGETA) $(OBJECTS)
+	-$(DEL_FILE) ../lib/$(TARGETA)
+	-$(MOVE) $(TARGETA) ../lib/
 
 dist: 
 	@$(CHK_DIR_EXISTS) .tmp/opencsg1.4.0 || $(MKDIR) .tmp/opencsg1.4.0 
@@ -147,8 +152,8 @@
 ####### Sub-libraries
 
 distclean: clean
-	-$(DEL_FILE) ../lib/$(TARGET) 
-	-$(DEL_FILE) ../lib/$(TARGET0) ../lib/$(TARGET1) ../lib/$(TARGET2) $(TARGETA)
+	-$(DEL_FILE) ../bin/$(TARGET) 
+	-$(DEL_FILE) ../lib/$(TARGETI) ../lib/$(TARGETA)
 	-$(DEL_FILE) Makefile
 
 
@@ -285,34 +290,38 @@
 ####### Install
 
 install_target: first FORCE
-	@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/lib/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/lib/ 
-	-$(INSTALL_PROGRAM) "../lib/$(TARGET)" "$(INSTALL_ROOT)/usr/local/lib/$(TARGET)"
-	-$(STRIP) --strip-unneeded "$(INSTALL_ROOT)/usr/local/lib/$(TARGET)"
-	-$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/usr/local/lib/$(TARGET0)"
-	-$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/usr/local/lib/$(TARGET1)"
-	-$(SYMLINK) "$(TARGET)" "$(INSTALL_ROOT)/usr/local/lib/$(TARGET2)"
+	@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)$(libdir) || $(MKDIR) $(INSTALL_ROOT)$(libdir)
+	@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)$(bindir) || $(MKDIR) $(INSTALL_ROOT)$(bindir)
+	-$(INSTALL_PROGRAM) "../bin/$(TARGET)" "$(INSTALL_ROOT)$(bindir)/$(TARGET)"
+	-$(INSTALL_PROGRAM) "../lib/$(TARGETA)" "$(INSTALL_ROOT)$(libdir)/$(TARGETA)"
+	-$(INSTALL_PROGRAM) "../lib/$(TARGETI)" "$(INSTALL_ROOT)$(libdir)/$(TARGETI)"
+	-$(STRIP) --strip-unneeded "$(INSTALL_ROOT)$(bindir)/$(TARGET)"
+
+install_static: first FORCE
+	@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)$(libdir) || $(MKDIR) $(INSTALL_ROOT)$(libdir)
+	-$(INSTALL_PROGRAM) "../lib/$(TARGETA)" "$(INSTALL_ROOT)$(libdir)/$(TARGETA)"
 
 uninstall_target:  FORCE
-	-$(DEL_FILE) "$(INSTALL_ROOT)/usr/local/lib/$(TARGET)" 
-	 -$(DEL_FILE) "$(INSTALL_ROOT)/usr/local/lib/$(TARGET0)" 
-	 -$(DEL_FILE) "$(INSTALL_ROOT)/usr/local/lib/$(TARGET1)" 
-	 -$(DEL_FILE) "$(INSTALL_ROOT)/usr/local/lib/$(TARGET2)"
-	-$(DEL_DIR) $(INSTALL_ROOT)/usr/local/lib/ 
+	-$(DEL_FILE) "$(INSTALL_ROOT)$(bindir)/$(TARGET)"
+	-$(DEL_FILE) "$(INSTALL_ROOT)$(bindir)/$(TARGETI)"
+	-$(DEL_DIR) $(INSTALL_ROOT)$(bindir)/
 
+uninstall_static:  FORCE
+	-$(DEL_FILE) "$(INSTALL_ROOT)$(bindir)/$(TARGETA)"
 
 install_headers: first FORCE
-	@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/include/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/include/ 
-	-$(INSTALL_FILE) ../include/opencsg.h $(INSTALL_ROOT)/usr/local/include/
+	@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)$(includedir)/ || $(MKDIR) $(INSTALL_ROOT)$(includedir)/ 
+	-$(INSTALL_FILE) ../include/opencsg.h $(INSTALL_ROOT)$(includedir)/
 
 
 uninstall_headers:  FORCE
-	-$(DEL_FILE) -r $(INSTALL_ROOT)/usr/local/include/opencsg.h
+	-$(DEL_FILE) -r $(INSTALL_ROOT)$(includedir)/opencsg.h
 	-$(DEL_DIR) $(INSTALL_ROOT)/usr/local/include/ 
 
 
-install:  install_target install_headers  FORCE
+install:  install_target install_static install_headers  FORCE
 
-uninstall: uninstall_target uninstall_headers   FORCE
+uninstall: uninstall_target uninstall_static uninstall_headers   FORCE
 
 FORCE:
 
