-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
123 lines (93 loc) · 2.71 KB
/
Makefile
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#############################################################################
# Library Makefile for building: libezxml
# Provided by Ron Brash @ron.brash@gmail.com
#############################################################################
LIBBASENAME = ezxml
MAJVER = 1
MINVER = 0
PATCHVER = 0
# Dont touch these TARGET definitions they're needed below
TARGET = lib$(LIBBASENAME).so.$(MAJVER).$(MINVER).$(PATCHVER)
TARGETA = lib$(LIBBASENAME).a
TARGETD = lib$(LIBBASENAME).so.$(MAJVER).$(MINVER).$(PATCHVER)
TARGET0 = lib$(LIBBASENAME).so
TARGET1 = lib$(LIBBASENAME).so.$(MAJVER)
TARGET2 = lib$(LIBBASENAME).so.$(MAJVER).$(MINVER)
####### Compiler, tools and options
LD := gcc
CC := $(CC)
CXX := g++
LEX := flex
YACC := yacc
CFLAGS := -Wall -fPIC $(CFLAGS)
CXXFLAGS := -Wall -fPIC $(CXXFLAGS)
LEXFLAGS :=
YACCFLAGS := -d
INCPATH := -I. -I/include/ -I/usr/include/
LINK := $(CC)
LFLAGS := -shared -Wl,-soname,$(TARGET)
LIBS := -L/lib/ -L/usr/lib
AR := ar
AR_ARGS := cqs
RANLIB :=
TAR = tar -cf
GZIP = gzip -9f
COPY = cp -f
COPY_FILE = $(COPY)
COPY_DIR = $(COPY) -r
INSTALL_FILE = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
DEL_FILE = rm -f
SYMLINK = ln -sf
DEL_DIR = rmdir
MOVE = mv -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
####### Output directory
OBJECTS_DIR = ./
####### Files
SOURCES = ezxml.c
OBJECTS = ezxml.o
first: all
####### Implicit rules
.SUFFIXES: .c .o .cpp .cc .cxx .C
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.C.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
####### Build rules
all: Makefile $(TARGET) $(TARGETA)
$(TARGET): $(UICDECLS) $(OBJECTS) $(SUBLIBS) $(OBJCOMP)
-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP)
-ln -s $(TARGET) $(TARGET0)
-ln -s $(TARGET) $(TARGET1)
-ln -s $(TARGET) $(TARGET2)
staticlib: $(TARGETA)
$(TARGETA): $(OBJECTS) $(OBJCOMP)
-$(DEL_FILE) $(TARGETA)
$(AR) $(AR_ARGS) $(TARGETA) $(OBJECTS) $(OBJMOC)
yaccclean:
lexclean:
clean:
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core *.so*
####### Sub-libraries
distclean: clean
-$(DEL_FILE) $(TARGET)
-$(DEL_FILE) $(TARGET0) $(TARGET1) $(TARGET2) $(TARGETA)
####### Compile
ezxml.o: ezxml.c ezxml.h
####### Install
install:
$(MKDIR) $(DESTDIR)/lib/
$(COPY_FILE) -a lib$(LIBBASENAME).so* /lib
$(COPY_FILE) -a *.h /usr/include/
uninstall: FORCE
FORCE: