From: Niko Liikanen Date: Thu, 24 Aug 2006 16:06:24 +0000 (+0000) Subject: Win32 tweaks X-Git-Tag: fs-1.0~25 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=6f4ac56492d45c04df0f205252b3c3210e319b4f;p=libs%2Fcore.git Win32 tweaks --- diff --git a/Makefile b/Makefile index a4e723f..d6e24b9 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +LIBRARY = path +LIBFILE = libmsppath + TMP = $(HOME)/nightwatch/tmp TGT = $(HOME)/nightwatch @@ -5,14 +8,18 @@ CXX = g++ CC = gcc AR = ar CP = cp + 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) +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))))) @@ -20,19 +27,19 @@ pkgincludedir = include/msp/$(LIBRARY) 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 -$(TMP)/$(LIBFILE).so: $(LIBOBJS) +$(TMP)/$(LIBFILE)$(SHARED): $(LIBOBJS) echo "Compiling $(notdir $@)" - $(CXX) $^ -shared -o $@ $(LIB) $(LIBRARYLIBS) + $(CXX) $^ -shared -o $@ $(LIB) # Static library -$(TMP)/$(LIBFILE).a: $(LIBOBJS) +$(TMP)/$(LIBFILE)$(STATIC): $(LIBOBJS) 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 $@))" - $(CXX) -fPIC $(CXXFLAGS) -c $< -o $@ + $(CXX) $(PIC) $(CXXFLAGS) -c $< -o $@ # Installs .PHONY: install diff --git a/source/path.cpp b/source/path.cpp index 9996137..b694214 100644 --- a/source/path.cpp +++ b/source/path.cpp @@ -4,6 +4,7 @@ Copyright © 2006 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ #include +#include "utils.h" #include "path.h" #include "utils.h" diff --git a/source/utils.cpp b/source/utils.cpp index f5fb3ab..bae91cc 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -6,7 +6,9 @@ Distributed under the LGPL #include #include #include +#ifndef WIN32 #include +#endif #include #include "path.h" #include "utils.h" @@ -147,10 +149,12 @@ Filename splitext(const string &fn) return result; } +#ifndef WIN32 int fnmatch(const string &pat, const Path &fn) { return ::fnmatch(pat.c_str(), fn.str().c_str(), FNM_PATHNAME); } +#endif } // namespace Path } // namespace Msp