X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=Makefile;fp=Makefile;h=83df8405397b6156175ccafdf471c1670690c955;hp=b88954c35ffe0769c2682af2ef2042385b90252c;hb=a883560b42163f5ed0c83204469d17dd4f0134b6;hpb=baf2ee40d68be74e6848a5f282ed369d5a616007 diff --git a/Makefile b/Makefile index b88954c..83df840 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +LIBRARY = framework +LIBFILE = libmspframework + TMP = $(HOME)/nightwatch/tmp TGT = $(HOME)/nightwatch @@ -5,14 +8,19 @@ 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 `pkg-config --cflags sigc++-2.0` CXXFLAGS = $(CFLAGS) +LIBLDFLAGS = -lpthreadGC2 -lsigc-2.0 +MAKEFLAGS += -s --no-print-directory + +PIC = -fPIC +SHARED = .so +STATIC = .a -LIBRARY = framework -LIBFILE = libmspframework SRC = source LIBOBJS = $(addprefix $(TMP)/, $(addsuffix .o, $(notdir $(basename $(wildcard $(SRC)/*.cpp))))) @@ -20,19 +28,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) $(LIBLDFLAGS) # Static library -$(TMP)/$(LIBFILE).a: $(LIBOBJS) +$(TMP)/$(LIBFILE)$(STATIC): $(LIBOBJS) echo "Compiling $(notdir $@)" $(AR) rcs $@ $^ @@ -47,7 +55,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