Libgourou

Libgourou Git Source Tree

Root/Makefile

1
2AR ?= $(CROSS)ar
3CXX ?= $(CROSS)g++
4
5UPDFPARSERLIB = ./lib/updfparser/libupdfparser.a
6
7CXXFLAGS=-Wall -fPIC -I./include -I./lib -I./lib/pugixml/src/ -I./lib/updfparser/include
8LDFLAGS = $(UPDFPARSERLIB)
9
10BUILD_STATIC ?= 0
11BUILD_SHARED ?= 1
12BUILD_UTILS ?= 1
13
14TARGETS =
15ifneq ($(BUILD_STATIC), 0)
16 TARGETS += libgourou.a
17endif
18ifneq ($(BUILD_SHARED), 0)
19 TARGETS += libgourou.so
20endif
21ifneq ($(BUILD_UTILS), 0)
22 TARGETS += build_utils
23endif
24
25
26ifneq ($(DEBUG),)
27CXXFLAGS += -ggdb -O0
28else
29CXXFLAGS += -O2
30endif
31
32SRCDIR := src
33INCDIR := inc
34BUILDDIR := obj
35TARGETDIR := bin
36SRCEXT := cpp
37OBJEXT := o
38
39SOURCES = src/libgourou.cpp src/user.cpp src/device.cpp src/fulfillment_item.cpp src/bytearray.cpp src/pugixml.cpp
40OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.$(OBJEXT)))
41
42all: lib obj $(TARGETS)
43
44lib:
45mkdir lib
46./scripts/setup.sh
47
48obj:
49mkdir obj
50
51$(BUILDDIR)/%.$(OBJEXT): $(SRCDIR)/%.$(SRCEXT)
52$(CXX) $(CXXFLAGS) -c $^ -o $@
53
54libgourou: libgourou.a libgourou.so
55
56libgourou.a: $(OBJECTS)
57$(AR) crs $@ obj/*.o $(LDFLAGS)
58
59libgourou.so: $(OBJECTS) $(UPDFPARSERLIB)
60$(CXX) obj/*.o $(LDFLAGS) -o $@ -shared
61
62build_utils:
63make -C utils ROOT=$(PWD) CXX=$(CXX) AR=$(AR) DEBUG=$(DEBUG) STATIC_UTILS=$(STATIC_UTILS)
64
65clean:
66rm -rf libgourou.a libgourou.so obj
67make -C utils clean
68
69ultraclean: clean
70rm -rf lib
71make -C utils ultraclean

Archive Download this file

Branches

Tags