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`
CXXFLAGS = $(CFLAGS)
+MAKEFLAGS += -s --no-print-directory
+
+PIC = -fPIC
+SHARED = .so
+STATIC = .a
LIBRARY = parser
LIBFILE = libmspparser
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