uPDFParser

uPDFParser Git Source Tree

Root/Makefile

1
2AR ?= $(CROSS)ar
3CXX ?= $(CROSS)g++
4
5CXXFLAGS=-Wall -fPIC -I./include
6LDFLAGS=
7
8BUILD_STATIC ?= 0
9BUILD_SHARED ?= 1
10
11TARGETS =
12ifneq ($(BUILD_STATIC), 0)
13 TARGETS += libupdfparser.a
14endif
15ifneq ($(BUILD_SHARED), 0)
16 TARGETS += libupdfparser.so
17endif
18
19ifneq ($(DEBUG),)
20CXXFLAGS += -ggdb -O0
21else
22CXXFLAGS += -O2
23endif
24
25SRCDIR := src
26INCDIR := inc
27BUILDDIR := obj
28TARGETDIR := bin
29SRCEXT := cpp
30OBJEXT := o
31
32SOURCES = src/uPDFParser.cpp src/uPDFTypes.cpp
33OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.$(OBJEXT)))
34
35all: obj $(TARGETS)
36
37obj:
38mkdir obj
39
40$(BUILDDIR)/%.$(OBJEXT): $(SRCDIR)/%.$(SRCEXT)
41$(CXX) $(CXXFLAGS) -c $^ -o $@
42
43libupdfparser.a: $(OBJECTS)
44$(AR) crs $@ obj/*.o
45
46libupdfparser.so: $(OBJECTS)
47$(CXX) obj/*.o $(LDFLAGS) -o $@ -shared
48
49test: test.c libupdfparser.a
50g++ -ggdb -O0 $^ -o $@ -Iinclude libupdfparser.a
51
52clean:
53rm -rf libupdfparser.so libupdfparser.a obj

Archive Download this file

Branches