-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (51 loc) · 1.92 KB
/
Makefile
File metadata and controls
68 lines (51 loc) · 1.92 KB
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
#-------------------------------------------------------------------------------------------------------
# #
# Makefile for LIBMIME source file #
# #
#-------------------------------------------------------------------------------------------------------
PROJECT = libmime
TARGET = $(PROJECT)
--PREFIX = ./install
CXX = g++
CXXFLAGS = -Werror -std=c++11
CXXFLAGS += -Wall
CXXFLAGS += -I$(CURDIR)
#CXXFLAGS += -g
SUBDIRS = $(TARGET)
export CXX CXXFLAGS
#-------------------------------------------------------------------------------------------------------
# #
# Make rules #
# #
#-------------------------------------------------------------------------------------------------------
.PHONY: all clean install demo $(SUBDIRS)
all:$(SUBDIRS)
ar -rcs $(PROJECT).a $(shell find ./$(TARGET) -name "*.o")
$(CXX) -fPIC -shared $(CXXFLAGS) $(shell find ./$(TARGET) -name "*.cpp") -o $(PROJECT).so
$(SUBDIRS):
$(MAKE) -C $@
install:
$(shell if [ ! -d $(--PREFIX) ]; then mkdir $(--PREFIX); fi;)
$(shell if [ ! -d $(--PREFIX)/include ]; then mkdir $(--PREFIX)/include; fi;)
$(shell if [ ! -d $(--PREFIX)/lib ]; then mkdir $(--PREFIX)/lib; fi;)
@cp $(TARGET) $(--PREFIX)/include -rf
@mv ./$(PROJECT).a ./$(PROJECT).so $(--PREFIX)/lib
rm -rf `find ./$(--PREFIX)/include -name "*.o"`
rm -rf `find ./$(--PREFIX)/include -name "*.cpp"`
rm -rf `find ./$(--PREFIX)/include -name "Makefile"`
demo:
$(MAKE) -C demo
tags:
@rm -rf ./tags
ctags --exclude="docs" \
--exclude="*.o" \
--exclude="*.a" \
--exclude="*.so" \
--exclude="*.elf" \
--exclude="*.map" \
--exclude="*.lss" -R .
clean:
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir clean; \
done
@rm -rf $(shell find ./ -name "*.o")