[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@
|
---|
[28403] | 34 | UNAME := $(shell uname -o)
|
---|
[26648] | 35 | INCLUDES = -I. -I$(COMMON_DIR) -I$(COMMON_DIR)/src/lib
|
---|
[26822] | 36 | STRIP = @STRIP@
|
---|
[2900] | 37 | INSTALL = @INSTALL@
|
---|
[25149] | 38 | LDFLAGS = @LDFLAGS@ @ARCH_DEP_FLAGS@
|
---|
[15917] | 39 | LIBS = @LIBS@
|
---|
| 40 |
|
---|
| 41 |
|
---|
[26648] | 42 | CCOMPILE = $(CC) -c $(CFLAGS) $(DEFS) $(INCLUDES)
|
---|
[15917] | 43 | CXXCOMPILE = $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
|
---|
| 44 | CXXLINK = $(CXX) $(LDFLAGS) -o $@
|
---|
| 45 |
|
---|
| 46 |
|
---|
[26648] | 47 | #.SUFFIXES:
|
---|
| 48 | #.SUFFIXES: .cpp .o
|
---|
| 49 | #.cpp.o:
|
---|
| 50 | # $(CXXCOMPILE) $<
|
---|
| 51 |
|
---|
| 52 | %.o: %.cpp
|
---|
[15917] | 53 | $(CXXCOMPILE) $<
|
---|
[1493] | 54 |
|
---|
[26648] | 55 | %.o: %.c
|
---|
| 56 | $(CCOMPILE) $<
|
---|
[1493] | 57 |
|
---|
[26648] | 58 |
|
---|
[15917] | 59 | SOURCES = \
|
---|
[26679] | 60 | getpw.cpp
|
---|
[1493] | 61 |
|
---|
[26679] | 62 | ifeq ($(GSDLOS),windows)
|
---|
[28403] | 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
|
---|
[26679] | 67 | endif
|
---|
| 68 |
|
---|
[26798] | 69 | ifeq ($(GSDLOS),android)
|
---|
| 70 | SOURCES += crypt.c crypt_util.c
|
---|
| 71 | endif
|
---|
| 72 |
|
---|
[15917] | 73 | OBJECTS = \
|
---|
[26679] | 74 | getpw.o
|
---|
[1493] | 75 |
|
---|
[26679] | 76 | ifeq ($(GSDLOS),windows)
|
---|
[28403] | 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
|
---|
[26679] | 81 | endif
|
---|
| 82 |
|
---|
[26798] | 83 | ifeq ($(GSDLOS),android)
|
---|
| 84 | OBJECTS += crypt.o crypt_util.o
|
---|
| 85 | endif
|
---|
| 86 |
|
---|
[15917] | 87 | EXECUTABLE_OBJECTS = \
|
---|
| 88 | $(OBJECTS)
|
---|
[1493] | 89 |
|
---|
[15917] | 90 | EXECUTABLE = getpw
|
---|
[1493] | 91 |
|
---|
| 92 |
|
---|
[15917] | 93 | # Default target: make the getpw executable
|
---|
| 94 | all: $(EXECUTABLE)
|
---|
[1493] | 95 |
|
---|
[15920] | 96 | getpw: $(EXECUTABLE_OBJECTS)
|
---|
[15917] | 97 | $(CXXLINK) $(EXECUTABLE_OBJECTS) $(LIBS)
|
---|
[1493] | 98 |
|
---|
[15917] | 99 | install: $(EXECUTABLE)
|
---|
| 100 | $(INSTALL) -d $(GSDL_DIR)/bin/$(GSDLOS)
|
---|
[26822] | 101 | $(STRIP) $(EXECUTABLE)
|
---|
| 102 | $(INSTALL) -m 755 $(EXECUTABLE) $(GSDL_DIR)/bin/$(GSDLOS)
|
---|
[1493] | 103 |
|
---|
[15917] | 104 | clean:
|
---|
| 105 | rm -f $(OBJECTS) $(EXECUTABLE)
|
---|
[1493] | 106 |
|
---|
[15917] | 107 | distclean:
|
---|
| 108 | rm -f $(OBJECTS) $(EXECUTABLE) Makefile
|
---|
[1493] | 109 |
|
---|
[15917] | 110 | depend:
|
---|
| 111 | makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) -- $(SOURCES)
|
---|