]> git.tdb.fi Git - libs/core.git/commitdiff
Win32 tweaks
authorNiko Liikanen <cloud@neo-midgar.com>
Thu, 24 Aug 2006 16:06:24 +0000 (16:06 +0000)
committerNiko Liikanen <cloud@neo-midgar.com>
Thu, 24 Aug 2006 16:06:24 +0000 (16:06 +0000)
Makefile
source/path.cpp
source/utils.cpp

index a4e723f1686acd755996b604540893e4ade5a968..d6e24b9a812c793cc24427ffa71fb08852c95152 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,6 @@
+LIBRARY                = path
+LIBFILE                = libmsppath
+
 TMP            = $(HOME)/nightwatch/tmp
 TGT            = $(HOME)/nightwatch
 
 TMP            = $(HOME)/nightwatch/tmp
 TGT            = $(HOME)/nightwatch
 
@@ -5,14 +8,18 @@ CXX           = g++
 CC             = gcc
 AR             = ar
 CP             = cp
 CC             = gcc
 AR             = ar
 CP             = cp
+
 INCLUDE                = -Isource -I$(TMP)/include
 LIB            = -L$(TMP)
 DEBUG          = 
 INCLUDE                = -Isource -I$(TMP)/include
 LIB            = -L$(TMP)
 DEBUG          = 
-CFLAGS         = $(DEBUG) $(INCLUDE) -pipe -Wall `pkg-config --cflags sigc++-2.0` `sdl-config --cflags`
+CFLAGS         = $(DEBUG) $(INCLUDE) -pipe -Wall
 CXXFLAGS       = $(CFLAGS)
 CXXFLAGS       = $(CFLAGS)
+MAKEFLAGS      += -s --no-print-directory
+
+PIC            = -fPIC
+SHARED         = .so
+STATIC         = .a
 
 
-LIBRARY                = path
-LIBFILE                = libmsppath
 SRC            = source
 LIBOBJS                = $(addprefix $(TMP)/, $(addsuffix .o, $(notdir $(basename $(wildcard $(SRC)/*.cpp)))))
 
 SRC            = source
 LIBOBJS                = $(addprefix $(TMP)/, $(addsuffix .o, $(notdir $(basename $(wildcard $(SRC)/*.cpp)))))
 
@@ -20,19 +27,19 @@ pkgincludedir       = include/msp/$(LIBRARY)
 libdir         = lib
 
 .PHONY: all
 libdir         = lib
 
 .PHONY: all
-all: $(TMP) $(TMP)/$(LIBFILE).so $(TMP)/$(LIBFILE).a tmpheaders
+all: $(TMP) $(TMP)/$(LIBFILE)$(SHARED) $(TMP)/$(LIBFILE)$(STATIC) tmpheaders
 
 # Create temp directory
 $(TMP):
        mkdir -p $@
 
 # Dynamic library
 
 # Create temp directory
 $(TMP):
        mkdir -p $@
 
 # Dynamic library
-$(TMP)/$(LIBFILE).so: $(LIBOBJS)
+$(TMP)/$(LIBFILE)$(SHARED): $(LIBOBJS)
        echo "Compiling $(notdir $@)"
        echo "Compiling $(notdir $@)"
-       $(CXX) $^ -shared -o $@ $(LIB) $(LIBRARYLIBS)
+       $(CXX) $^ -shared -o $@ $(LIB)
 
 # Static library
 
 # Static library
-$(TMP)/$(LIBFILE).a: $(LIBOBJS)
+$(TMP)/$(LIBFILE)$(STATIC): $(LIBOBJS)
        echo "Compiling $(notdir $@)"
        $(AR) rcs $@ $^
 
        echo "Compiling $(notdir $@)"
        $(AR) rcs $@ $^
 
@@ -47,7 +54,7 @@ $(TMP)/$(pkgincludedir):
 # Library object file
 $(TMP)/%.o: $(SRC)/%.cpp $(wildcard $(SRC)/*.h)
        echo "Compiling $(LIBRARY)/$(notdir $(basename $@))"
 # Library object file
 $(TMP)/%.o: $(SRC)/%.cpp $(wildcard $(SRC)/*.h)
        echo "Compiling $(LIBRARY)/$(notdir $(basename $@))"
-       $(CXX) -fPIC $(CXXFLAGS) -c $< -o $@
+       $(CXX) $(PIC) $(CXXFLAGS) -c $< -o $@
 
 # Installs
 .PHONY: install
 
 # Installs
 .PHONY: install
index 99961379977d65684da8f3209bc65d61570039e4..b6942149b927cf3befc95d2b9b5cb674a33d6b3f 100644 (file)
@@ -4,6 +4,7 @@ Copyright © 2006  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 #include <msp/strutils.h>
 Distributed under the LGPL
 */
 #include <msp/strutils.h>
+#include "utils.h"
 #include "path.h"
 #include "utils.h"
 
 #include "path.h"
 #include "utils.h"
 
index f5fb3abb846d4b6e126346c91b9164e1fa6200a3..bae91cc50898ad83838749f58987a9c3a182d61a 100644 (file)
@@ -6,7 +6,9 @@ Distributed under the LGPL
 #include <dirent.h>
 #include <sys/stat.h>
 #include <errno.h>
 #include <dirent.h>
 #include <sys/stat.h>
 #include <errno.h>
+#ifndef WIN32
 #include <fnmatch.h>
 #include <fnmatch.h>
+#endif
 #include <msp/strutils.h>
 #include "path.h"
 #include "utils.h"
 #include <msp/strutils.h>
 #include "path.h"
 #include "utils.h"
@@ -147,10 +149,12 @@ Filename splitext(const string &fn)
        return result;
 }
 
        return result;
 }
 
+#ifndef WIN32
 int fnmatch(const string &pat, const Path &fn)
 {
        return ::fnmatch(pat.c_str(), fn.str().c_str(), FNM_PATHNAME);
 }
 int fnmatch(const string &pat, const Path &fn)
 {
        return ::fnmatch(pat.c_str(), fn.str().c_str(), FNM_PATHNAME);
 }
+#endif
 
 } // namespace Path
 } // namespace Msp
 
 } // namespace Path
 } // namespace Msp