[23e682]: src / os / linux / Makefile  Maximize  Restore  History

Download this file

85 lines (63 with data), 2.0 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Makefile for Linux os-dependent library of
# pwsafe
#
#CONFIG=debug
#CONFIG=release
CONFIG=unicodedebug
#CONFIG=unicoderelease
WX_CONFIG?=/usr/bin/wx-config
CPPINC=`$(WX_CONFIG) --debug=no --unicode=yes --inplace --cxxflags`
DEPDIR= ./deps
NAME=os
ifndef NO_YUBI
YUBI_SRC=PWYubi.cpp
YBPERS_INC?=/usr/local/include/ykpers-1
endif
LIBSRC = debug.cpp dir.cpp env.cpp \
file.cpp logit.cpp mem.cpp pws_str.cpp \
pws_time.cpp rand.cpp run.cpp\
utf8conv.cpp KeySend.cpp\
sleep.cpp xsendstring.cpp\
registry.cpp UUID.cpp\
unicode2keysym.cpp $(YUBI_SRC)
SRC = $(LIBSRC)
OBJPATH = ../../../obj/$(CONFIG)/$(NAME)
LIBPATH = ../../../lib/$(CONFIG)
#destination related macros
LIBOBJ = $(addprefix $(OBJPATH)/,$(subst .cpp,.o,$(LIBSRC)))
LIB = $(LIBPATH)/libos.a
OBJ = $(LIBOBJ)
CPPFLAGS = $(CXXFLAGS) -Wall -I../../core -I../.. $(CPPINC) -I$(YBPERS_INC)
ifeq ($(CONFIG),debug)
CPPFLAGS += -O0 -g -ggdb -DDEBUG
CFLAGS += -g
else ifeq ($(CONFIG),release)
CPPFLAGS += -O -DNDEBUG
else ifeq ($(CONFIG),unicodedebug)
CPPFLAGS += -O0 -g -ggdb -DUNICODE -DDEBUG
CFLAGS += -g
else ifeq ($(CONFIG),unicoderelease)
CPPFLAGS += -O -DUNICODE -DNDEBUG
endif
# rules
.PHONY: all debug release unicodedebug unicoderelease clean setup
$(OBJPATH)/%.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJPATH)/%.o : %.cpp
$(CXX) $(CPPFLAGS) -c $< -o $@
all : setup $(LIB)
debug release unicodedebug unicoderelease:
$(MAKE) all CONFIG=$@
$(LIB): $(LIBOBJ)
ar rvus $@ $(filter %.o,$^)
clean:
@rm -f *~ $(OBJ) $(TEST) $(LIB)
@rm -rf $(DEPDIR)
setup:
@mkdir -p $(OBJPATH) $(LIBPATH)
$(DEPDIR)/%.d: %.cpp
@set -e; mkdir -p $(DEPDIR); $(RM) $@; \
$(CXX) -MM $(CPPFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,$(OBJECTPATH)/\1.o $@ : ,g' < $@.$$$$ > $@; \
$(RM) $@.$$$$
-include $(SRC:%.cpp=$(DEPDIR)/%.d)

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks