[1493] | 1 | ###########################################################################
|
---|
| 2 | #
|
---|
[15917] | 3 | # Makefile -- src/getpw
|
---|
[1493] | 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 | #
|
---|
[15917] | 8 | # Copyright (C) 2000-2008 The New Zealand Digital Library Project
|
---|
[1493] | 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 |
|
---|
[16615] | 26 | GSDL_DIR = ../../..
|
---|
| 27 | COMMON_DIR = $(GSDL_DIR)/common-src
|
---|
[15917] | 28 |
|
---|
[26648] | 29 | CC = @CC@
|
---|
[2276] | 30 | CXX = @CXX@
|
---|
[25149] | 31 | CXXFLAGS = @CXXFLAGS@ @ARCH_DEP_FLAGS@
|
---|
[1493] | 32 | DEFS = @DEFS@
|
---|
| 33 | GSDLOS = @gsdlos@
|
---|
[26648] | 34 | INCLUDES = -I. -I$(COMMON_DIR) -I$(COMMON_DIR)/src/lib
|
---|
[2900] | 35 | INSTALL = @INSTALL@
|
---|
[25149] | 36 | LDFLAGS = @LDFLAGS@ @ARCH_DEP_FLAGS@
|
---|
[15917] | 37 | LIBS = @LIBS@
|
---|
| 38 |
|
---|
| 39 |
|
---|
[26648] | 40 | CCOMPILE = $(CC) -c $(CFLAGS) $(DEFS) $(INCLUDES)
|
---|
[15917] | 41 | CXXCOMPILE = $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
|
---|
| 42 | CXXLINK = $(CXX) $(LDFLAGS) -o $@
|
---|
| 43 |
|
---|
| 44 |
|
---|
[26648] | 45 | #.SUFFIXES:
|
---|
| 46 | #.SUFFIXES: .cpp .o
|
---|
| 47 | #.cpp.o:
|
---|
| 48 | # $(CXXCOMPILE) $<
|
---|
| 49 |
|
---|
| 50 | %.o: %.cpp
|
---|
[15917] | 51 | $(CXXCOMPILE) $<
|
---|
[1493] | 52 |
|
---|
[26648] | 53 | %.o: %.c
|
---|
| 54 | $(CCOMPILE) $<
|
---|
[1493] | 55 |
|
---|
[26648] | 56 |
|
---|
[15917] | 57 | SOURCES = \
|
---|
[26679] | 58 | getpw.cpp
|
---|
[1493] | 59 |
|
---|
[26679] | 60 | ifeq ($(GSDLOS),windows)
|
---|
| 61 | # e.g. we are cross-compiling with mingw under Linux
|
---|
| 62 | SOURCES += crypt.c crypt_util.c getpass.c
|
---|
| 63 | endif
|
---|
| 64 |
|
---|
[26798] | 65 | ifeq ($(GSDLOS),android)
|
---|
| 66 | SOURCES += crypt.c crypt_util.c
|
---|
| 67 | endif
|
---|
| 68 |
|
---|
[15917] | 69 | OBJECTS = \
|
---|
[26679] | 70 | getpw.o
|
---|
[1493] | 71 |
|
---|
[26679] | 72 | ifeq ($(GSDLOS),windows)
|
---|
| 73 | # e.g. we are cross-compiling with mingw under Linux
|
---|
| 74 | OBJECTS += crypt.o crypt_util.o getpass.o
|
---|
| 75 | endif
|
---|
| 76 |
|
---|
[26798] | 77 | ifeq ($(GSDLOS),android)
|
---|
| 78 | OBJECTS += crypt.o crypt_util.o
|
---|
| 79 | endif
|
---|
| 80 |
|
---|
[15917] | 81 | EXECUTABLE_OBJECTS = \
|
---|
| 82 | $(OBJECTS)
|
---|
[1493] | 83 |
|
---|
[15917] | 84 | EXECUTABLE = getpw
|
---|
[1493] | 85 |
|
---|
| 86 |
|
---|
[15917] | 87 | # Default target: make the getpw executable
|
---|
| 88 | all: $(EXECUTABLE)
|
---|
[1493] | 89 |
|
---|
[15920] | 90 | getpw: $(EXECUTABLE_OBJECTS)
|
---|
[15917] | 91 | $(CXXLINK) $(EXECUTABLE_OBJECTS) $(LIBS)
|
---|
[1493] | 92 |
|
---|
[15917] | 93 | install: $(EXECUTABLE)
|
---|
| 94 | $(INSTALL) -d $(GSDL_DIR)/bin/$(GSDLOS)
|
---|
[15921] | 95 | $(INSTALL) -m 755 -s $(EXECUTABLE) $(GSDL_DIR)/bin/$(GSDLOS)
|
---|
[1493] | 96 |
|
---|
[15917] | 97 | clean:
|
---|
| 98 | rm -f $(OBJECTS) $(EXECUTABLE)
|
---|
[1493] | 99 |
|
---|
[15917] | 100 | distclean:
|
---|
| 101 | rm -f $(OBJECTS) $(EXECUTABLE) Makefile
|
---|
[1493] | 102 |
|
---|
[15917] | 103 | depend:
|
---|
| 104 | makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) -- $(SOURCES)
|
---|