Updated Makefile
authorNiko Liikanen <cloud@neo-midgar.com>
Mon, 4 Sep 2006 11:04:46 +0000 (11:04 +0000)
committerNiko Liikanen <cloud@neo-midgar.com>
Mon, 4 Sep 2006 11:04:46 +0000 (11:04 +0000)
Makefile

index c316117cb61878639a9cbbea01f26c0a1bd98dc9..1424119b19e8ed9717514edf30984cf6a8cf7c63 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,29 +1,31 @@
-LIBRARY                = path
-LIBFILE                = libmsppath
+NAME           = path
 
-TMP            = $(HOME)/nightwatch/tmp
-TGT            = $(HOME)/nightwatch
+WORKDIR                = $(PWD)/../..
+TMP            = $(WORKDIR)/tmp/linux
+TGT            = $(HOME)/local
 
 CXX            = g++
 CC             = gcc
 AR             = ar
 CP             = cp
 
+LIBFILE                = libmsp$(NAME)
+
+MAKEFLAGS      += -s --no-print-directory
 INCLUDE                = -Isource -I$(TMP)/include
 LIB            = -L$(TMP)
 DEBUG          = 
-CFLAGS         = $(DEBUG) $(INCLUDE) -pipe -Wall
+CFLAGS         = $(DEBUG) $(INCLUDE) -pipe -Wall 
 CXXFLAGS       = $(CFLAGS)
-MAKEFLAGS      += -s --no-print-directory
 
 PIC            = -fPIC
 SHARED         = .so
 STATIC         = .a
 
 SRC            = source
-LIBOBJS                = $(addprefix $(TMP)/, $(addsuffix .o, $(notdir $(basename $(wildcard $(SRC)/*.cpp)))))
+OBJS           = $(addprefix $(TMP)/, $(addsuffix .o, $(notdir $(basename $(wildcard $(SRC)/*.cpp)))))
 
-pkgincludedir  = include/msp/$(LIBRARY)
+pkgincludedir  = include/msp/$(NAME)
 libdir         = lib
 
 .PHONY: all
@@ -34,12 +36,12 @@ $(TMP):
        mkdir -p $@
 
 # Dynamic library
-$(TMP)/$(LIBFILE)$(SHARED): $(LIBOBJS)
+$(TMP)/$(LIBFILE)$(SHARED): $(OBJS)
        echo "Compiling $(notdir $@)"
        $(CXX) $^ -shared -o $@ $(LIB)
 
 # Static library
-$(TMP)/$(LIBFILE)$(STATIC): $(LIBOBJS)
+$(TMP)/$(LIBFILE)$(STATIC): $(OBJS)
        echo "Compiling $(notdir $@)"
        $(AR) rcs $@ $^
 
@@ -53,12 +55,12 @@ $(TMP)/$(pkgincludedir):
 
 # Library object file
 $(TMP)/%.o: $(SRC)/%.cpp $(wildcard $(SRC)/*.h)
-       echo "Compiling $(LIBRARY)/$(notdir $(basename $@))"
+       echo "Compiling $(NAME)/$(notdir $(basename $@))"
        $(CXX) $(PIC) $(CXXFLAGS) -c $< -o $@
 
 # Installs
 .PHONY: install
-install: install_lib
+install: install_lib 
 
 $(TGT)/$(pkgincludedir):
        mkdir -p $@
@@ -68,7 +70,7 @@ $(TGT)/$(libdir):
 
 .PHONY: install_headers
 install_headers: $(TGT)/$(pkgincludedir)
-       echo "Installing $(LIBRARY) headers to $<"
+       echo "Installing $(NAME) headers to $<"
        $(CP) $(SRC)/*.h $<
 
 .PHONY: install_lib