
Untitled
By: a guest on
Apr 6th, 2012 | syntax:
Make | size: 1.06 KB | hits: 31 | expires: Never
#====================================
# Makefile for building: libjsoncpp.a
#====================================
# Definitions
#------------
# C compiler
CC = gcc
# C++ compiler
CXX = g++
# Include file directory
INCLUDES = -I ./include
# Object file directory
OBJ_DIR = ./obj
# C++ flags
CXXFLAGS = -W -Wall -Wextra -Wno-unused -pedantic -std=c++03 -march=native -O3
# Macros
#-------
# Tests for the obj directory
TEST_OBJ = test -d obj
# Makes the obj directory
MAKE_OBJ = mkdir obj
# Removes the obj directory
REM_OBJ = rm -rf obj
.phony: all clean
all: object_directory json_reader.o json_writer.o json_value.o
ar -r libjsoncpp.a obj/json_reader.o obj/json_writer.o obj/json_value.o
clean:
$(REM_OBJ)
%.o: src/lib_json/%.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o obj/$@ $<
object_directory:
$(TEST_OBJ) || $(MAKE_OBJ)
install:
sudo cp -r include/json --target-directory=/usr/include
cp libjsoncpp.a /usr/lib/libjsoncpp.a