1 | ###########################################################################
|
---|
2 | #
|
---|
3 | # Makefile -- src/getpw
|
---|
4 | # A component of the Greenstone digital library software
|
---|
5 | # from the New Zealand Digital Library Project at the
|
---|
6 | # University of Waikato, New Zealand.
|
---|
7 | #
|
---|
8 | # Copyright (C) 2000-2008 The New Zealand Digital Library Project
|
---|
9 | #
|
---|
10 | # This program is free software; you can redistribute it and/or modify
|
---|
11 | # it under the terms of the GNU General Public License as published by
|
---|
12 | # the Free Software Foundation; either version 2 of the License, or
|
---|
13 | # (at your option) any later version.
|
---|
14 | #
|
---|
15 | # This program is distributed in the hope that it will be useful,
|
---|
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
18 | # GNU General Public License for more details.
|
---|
19 | #
|
---|
20 | # You should have received a copy of the GNU General Public License
|
---|
21 | # along with this program; if not, write to the Free Software
|
---|
22 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
23 | #
|
---|
24 | ###########################################################################
|
---|
25 |
|
---|
26 | GSDL_DIR = ../../..
|
---|
27 | COMMON_DIR = $(GSDL_DIR)/common-src
|
---|
28 |
|
---|
29 | CC = @CC@
|
---|
30 | CXX = @CXX@
|
---|
31 | CXXFLAGS = @CXXFLAGS@ @ARCH_DEP_FLAGS@
|
---|
32 | DEFS = @DEFS@
|
---|
33 | GSDLOS = @gsdlos@
|
---|
34 | UNAME := $(shell uname -o)
|
---|
35 | INCLUDES = -I. -I$(COMMON_DIR) -I$(COMMON_DIR)/src/lib
|
---|
36 | STRIP = @STRIP@
|
---|
37 | INSTALL = @INSTALL@
|
---|
38 | LDFLAGS = @LDFLAGS@ @ARCH_DEP_FLAGS@
|
---|
39 | LIBS = @LIBS@
|
---|
40 |
|
---|
41 |
|
---|
42 | CCOMPILE = $(CC) -c $(CFLAGS) $(DEFS) $(INCLUDES)
|
---|
43 | CXXCOMPILE = $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
|
---|
44 | CXXLINK = $(CXX) $(LDFLAGS) -o $@
|
---|
45 |
|
---|
46 |
|
---|
47 | #.SUFFIXES:
|
---|
48 | #.SUFFIXES: .cpp .o
|
---|
49 | #.cpp.o:
|
---|
50 | # $(CXXCOMPILE) $<
|
---|
51 |
|
---|
52 | %.o: %.cpp
|
---|
53 | $(CXXCOMPILE) $<
|
---|
54 |
|
---|
55 | %.o: %.c
|
---|
56 | $(CCOMPILE) $<
|
---|
57 |
|
---|
58 |
|
---|
59 | SOURCES = \
|
---|
60 | getpw.cpp
|
---|
61 |
|
---|
62 | ifeq ($(GSDLOS),windows)
|
---|
63 | ifneq ($(UNAME),Cygwin)
|
---|
64 | # e.g. we are cross-compiling with mingw under Linux
|
---|
65 | SOURCES += crypt.c crypt_util.c getpass.c
|
---|
66 | endif
|
---|
67 | endif
|
---|
68 |
|
---|
69 | ifeq ($(GSDLOS),android)
|
---|
70 | SOURCES += crypt.c crypt_util.c
|
---|
71 | endif
|
---|
72 |
|
---|
73 | OBJECTS = \
|
---|
74 | getpw.o
|
---|
75 |
|
---|
76 | ifeq ($(GSDLOS),windows)
|
---|
77 | ifneq ($(UNAME),Cygwin)
|
---|
78 | # e.g. we are cross-compiling with mingw under Linux
|
---|
79 | OBJECTS += crypt.o crypt_util.o getpass.o
|
---|
80 | endif
|
---|
81 | endif
|
---|
82 |
|
---|
83 | ifeq ($(GSDLOS),android)
|
---|
84 | OBJECTS += crypt.o crypt_util.o
|
---|
85 | endif
|
---|
86 |
|
---|
87 | EXECUTABLE_OBJECTS = \
|
---|
88 | $(OBJECTS)
|
---|
89 |
|
---|
90 | EXECUTABLE = getpw
|
---|
91 |
|
---|
92 |
|
---|
93 | # Default target: make the getpw executable
|
---|
94 | all: $(EXECUTABLE)
|
---|
95 |
|
---|
96 | getpw: $(EXECUTABLE_OBJECTS)
|
---|
97 | $(CXXLINK) $(EXECUTABLE_OBJECTS) $(LIBS)
|
---|
98 |
|
---|
99 | install: $(EXECUTABLE)
|
---|
100 | $(INSTALL) -d $(GSDL_DIR)/bin/$(GSDLOS)
|
---|
101 | $(STRIP) $(EXECUTABLE)
|
---|
102 | $(INSTALL) -m 755 $(EXECUTABLE) $(GSDL_DIR)/bin/$(GSDLOS)
|
---|
103 |
|
---|
104 | clean:
|
---|
105 | rm -f $(OBJECTS) $(EXECUTABLE)
|
---|
106 |
|
---|
107 | distclean:
|
---|
108 | rm -f $(OBJECTS) $(EXECUTABLE) Makefile
|
---|
109 |
|
---|
110 | depend:
|
---|
111 | makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) -- $(SOURCES)
|
---|