summaryrefslogtreecommitdiff
path: root/recipes-support/jsoncpp/jsoncpp-0.5.0/Makefile
blob: 3be37434318b14a0469e1e21cccb45e474d5994e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
includedir ?= /usr/include
libdir ?= /usr/lib

CPP_SRCS += \
src/lib_json/json_reader.cpp \
src/lib_json/json_value.cpp \
src/lib_json/json_writer.cpp 

OBJS += \
json_reader.o \
json_value.o \
json_writer.o 

CPP_DEPS += \
json_reader.d \
json_value.d \
json_writer.d 

all: libjsoncpp.a

libjsoncpp.a: $(OBJS)
	@echo 'Building target: $@'
	$(AR) -r  libjsoncpp.a $(OBJS)
	@echo 'Finished building target: $@'
	@echo ' '

%.o: src/lib_json/%.cpp
	@echo 'Building file: $<'
	$(CXX) $(CFLAGS) -Iinclude -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
	@echo 'Finished building: $<'
	@echo ' '

install:
	mkdir -p $(DESTDIR)$(libdir)
	mkdir -p $(DESTDIR)$(includedir)/jsoncpp/json
	cp libjsoncpp.a $(DESTDIR)$(libdir)/
	cp include/json/* $(DESTDIR)$(includedir)/jsoncpp/json/

# Other Targets
clean:
	-$(RM) $(OBJS)$(CPP_DEPS) libjsoncpp.a
	-@echo ' '

.PHONY: all clean dependents
.SECONDARY: