source: main/trunk/greenstone2/common-src/src/getpw/Makefile.in

Last change on this file was 28403, checked in by davidb, 11 years ago

Support for compiling from Cygwin added

  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
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
26GSDL_DIR = ../../..
27COMMON_DIR = $(GSDL_DIR)/common-src
28
29CC = @CC@
30CXX = @CXX@
31CXXFLAGS = @CXXFLAGS@ @ARCH_DEP_FLAGS@
32DEFS = @DEFS@
33GSDLOS = @gsdlos@
34UNAME := $(shell uname -o)
35INCLUDES = -I. -I$(COMMON_DIR) -I$(COMMON_DIR)/src/lib
36STRIP = @STRIP@
37INSTALL = @INSTALL@
38LDFLAGS = @LDFLAGS@ @ARCH_DEP_FLAGS@
39LIBS = @LIBS@
40
41
42CCOMPILE = $(CC) -c $(CFLAGS) $(DEFS) $(INCLUDES)
43CXXCOMPILE = $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
44CXXLINK = $(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
59SOURCES = \
60 getpw.cpp
61
62ifeq ($(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
67endif
68
69ifeq ($(GSDLOS),android)
70 SOURCES += crypt.c crypt_util.c
71endif
72
73OBJECTS = \
74 getpw.o
75
76ifeq ($(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
81endif
82
83ifeq ($(GSDLOS),android)
84 OBJECTS += crypt.o crypt_util.o
85endif
86
87EXECUTABLE_OBJECTS = \
88 $(OBJECTS)
89
90EXECUTABLE = getpw
91
92
93# Default target: make the getpw executable
94all: $(EXECUTABLE)
95
96getpw: $(EXECUTABLE_OBJECTS)
97 $(CXXLINK) $(EXECUTABLE_OBJECTS) $(LIBS)
98
99install: $(EXECUTABLE)
100 $(INSTALL) -d $(GSDL_DIR)/bin/$(GSDLOS)
101 $(STRIP) $(EXECUTABLE)
102 $(INSTALL) -m 755 $(EXECUTABLE) $(GSDL_DIR)/bin/$(GSDLOS)
103
104clean:
105 rm -f $(OBJECTS) $(EXECUTABLE)
106
107distclean:
108 rm -f $(OBJECTS) $(EXECUTABLE) Makefile
109
110depend:
111 makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) -- $(SOURCES)
Note: See TracBrowser for help on using the repository browser.