File: unix.mak

package info (click to toggle)
passwordmaker-cli 1.5%2Bdfsg-4
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 636 kB
  • sloc: cpp: 6,768; makefile: 29
file content (75 lines) | stat: -rwxr-xr-x 2,450 bytes parent folder | download | duplicates (2)
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
# PasswordMaker - Creates and manages passwords
# Copyright (C) 2005 Eric H. Jung and LeahScape, Inc.
# http://passwordmaker.org/
# grimholtz@yahoo.com
# 
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or (at
# your option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESSFOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
# for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# 
# Written by Miquel Burns <miquelfire@gmail.com> and Eric H. Jung

# USE_MAC   -   1 = compile on a MAC, 0 = compile elsewhere
# FINK_REPO -   Location of your MAC FINK software repository, you must have 
#               libmhash and libpcre installed.
USE_MAC = 0
FINK_REPO = /sw

LINK = $(CXX)
DEFINES = -DUSE_MHASH -DTIXML_USE_STL
CFLAGS = -O2 -Wall $(DEFINES)
CXXFLAGS = -O2 -frtti -fexceptions -Wall $(DEFINES)
CFLAGS += $(shell dpkg-buildflags --get CFLAGS)
CXXFLAGS += $(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS += $(shell dpkg-buildflags --get LDFLAGS)
CPPFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
INCPATH = -I.
LIBS = -lmhash -lpcrecpp

ifeq ($(USE_MAC), 1)
	CFLAGS := $(CFLAGS) -m32
	CXXFLAGS := $(CXXFLAGS) -m32
	INCPATH := -I$(FINK_REPO)/include $(INCPATH)
	LIBS := -m32 -L$(FINK_REPO)/lib $(LIBS)
endif

SOURCE = shared/hasher.cpp leet.cpp main.cpp passwordmaker.cpp pwmdefaults.cpp tinystr.cpp tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp listaccounts.cpp urlsearch.cpp
OBJECTS = $(SOURCE:.cpp=.o)
TARGET = passwordmaker

$(TARGET):  $(OBJECTS) 
	$(LINK) -o "$(TARGET)" $(OBJECTS)  $(LIBS) $(LDFLAGS)

.SUFFIXES: .c .cpp .cc .cxx

.cpp.o:
	$(CXX) -g -c $(CXXFLAGS) $(CPPFLAGS) $(INCPATH) -o $@ $<

.cc.o:
	$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $(INCPATH) -o $@ $<

.cxx.o:
	$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $(INCPATH) -o $@ $<

.c.o:
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(INCPATH) -o $@ $<

include unix/depends

.PHONY: depend clean

depend:
	$(CXX) -MM $(CXXFLAGS) $(INCPATH) $(SOURCE) > unix/depends 

clean:
	rm -f $(OBJECTS) $(TARGET) 2>/dev/null