+LIBRARY = path
+LIBFILE = libmsppath
+
TMP = $(HOME)/nightwatch/tmp
TGT = $(HOME)/nightwatch
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)))))
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 $@ $^
# 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
#include <dirent.h>
#include <sys/stat.h>
#include <errno.h>
+#ifndef WIN32
#include <fnmatch.h>
+#endif
#include <msp/strutils.h>
#include "path.h"
#include "utils.h"
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