Need a Makefile expert.

Julian Elischer julian at elischer.org
Wed Oct 1 15:20:15 PDT 2003


I'm trying to compile npasswd (from utexas).
I know that it doesn't work on freeBSD, but I have
some work to make it do so, if only I could get the damned thing to
compile automatically.. (I can do lots of it by hand but it's a pain)

After running Configure, I type "make"
and I get:
[lots-o-stuff]
Making all in src...
cd Methods; make   libmethod.a
make: don't know how to make .o. Stop
*** Error code 2

Stop in /usr/tmp/npasswd/npasswd-2.05/src.
*** Error code 1

Stop in /usr/tmp/npasswd/npasswd-2.05.
*** Error code 1

Stop in /usr/tmp/npasswd/npasswd-2.05.

The Makefile from src/Methods is attached..
I've stared at it but I'm not seeing the problem.

the directory contains:
> ls -latr src/Methods/
total 149
-r--r--r--  1 julian  staff  10165 May  7  1998 pwm_nisplus.c
-r--r--r--  1 julian  staff   1786 Jul 14  1998 passwdtab.h.SH
-r--r--r--  1 julian  staff   1615 Jul 14  1998 shadowtab.h.SH
-r--r--r--  1 julian  staff   3845 Jul 17  1998 shm_aix.c
-r--r--r--  1 julian  staff   1015 Jul 20  1998 shm_null.c
-r--r--r--  1 julian  staff   3142 Jul 20  1998 shm_ultrix.c
-r--r--r--  1 julian  staff   8402 Jul 20  1998 shm_osf1.c
-r--r--r--  1 julian  staff   1954 Aug 17  1998 pwm_defs.h
-r--r--r--  1 julian  staff   8536 Oct 13  1998 shm_adjunct.c
-r--r--r--  1 julian  staff  13312 Oct 13  1998 pwm_local.c
-r--r--r--  1 julian  staff   8412 Oct 13  1998 shm_shadow.c
-r--r--r--  1 julian  staff   5642 Feb  1  1999 pwm_main.c
-r--r--r--  1 julian  staff   6712 Feb  1  1999 shm_hpux.c
drwxr-xr-x  3 julian  staff    512 Jul 11 13:40 TestSuite
-r--r--r--  1 julian  staff  20343 Jul 11 13:53 pwm_nis.c
-rw-r--r--  1 julian  staff    571 Oct  1 14:31 shadowtab.h
-rw-r--r--  1 julian  staff    579 Oct  1 14:31 passwdtab.h
-rw-r--r--  1 julian  staff      0 Oct  1 14:31 Makefile.local
-rw-r--r--  1 julian  staff   9214 Oct  1 14:31 Makefile.bak
-rw-r--r--  1 julian  staff   2900 Oct  1 14:34 pwm_main.o
drwxr-xr-x  6 julian  staff   1024 Oct  1 14:34 ..
drwxr-xr-x  3 julian  staff   1024 Oct  1 14:34 .
-rw-r--r--  1 julian  staff   4512 Oct  1 14:34 pwm_local.o
-rw-r--r--  1 julian  staff    785 Oct  1 14:34 pwm_nis.o
-rw-r--r--  1 julian  staff  10032 Oct  1 14:39 Makefile.SH
-rw-r--r--  1 julian  staff   9214 Oct  1 15:07 Makefile

(I'm hopin gthat, having posted this, the problem becomes immediatly
obvious to me :-) (but I wouldn't count on it)

-------------- next part --------------
########################################################################
# Makefile generated from Makefile.SH on Wed Oct  1 14:39:29 PDT 2003

SHELL = /bin/sh
JMAKE = jmake
TOP = ../../
CURRENT = src/Methods
DIR = src/Methods/

########################################################################
# Parameters set by Configure -- edit config.sh if changes are needed

AR = ar rc
CC = cc
CTAGS = ctags
JCFLAGS = $(CFLAGS) -O  
LINT = lint
MAKE = make
MKDEP = /usr/tmp/npasswd/npasswd-2.05/mkdep $(DPFLAGS) --
MV = mv
RANLIB = :
RM = rm -f
SED = sed

########################################################################
# Automatically generated parameters -- do not edit

X_CCDEBUG =  -g
X_COPT =  -O
X_CFLAGS =   -DOS_NAME=freebsd -DOS_MAJOR_VERSION=4 -DOS_MINOR_VERSION=8- $(INCLUDE_PATH)
X_LDFLAGS =  
X_LOCAL_CFLAGS =
LOCAL_FLAGS =  Makefile.local
JCFLAGS =  $(X_CFLAGS) $(X_COPT) $(X_LOCAL_CFLAGS)
JLDFLAGS =  $(X_LDFLAGS) $(X_LOCAL_CFLAGS)
LNS =  /bin/ln -s
DPFLAGS =  $(INCLUDE_PATH)
LINTFLAGS =  $(X_CFLAGS) 
INCLUDE_PATH =  -I.. -I../.. -I../Common
SHADOW_M =  
OBJECTS =   $(METHOD_OBJ) $(SHADOW_M).o
SOURCES =  $(SHADOWM_SRC)  $(PASSWDM_SRC)

########################################################################
# New suffixes and associated building rules -- edit with care

.c.o:
	$(RM) $@
	$(CC) -c $(JCFLAGS) $<

########################################################################
# Jmake rules for building libraries, programs, scripts, and data files
# $X-Id: Jmake.rules,v 3.0.1.5 1995/09/25 09:07:19 ram Exp $

########################################################################
# Force 'make depend' to be performed first -- do not edit

.FORCE_DEPEND::

all:: .FORCE_DEPEND

########################################################################
# Start of Jmakefile
#
# Copyright 1998, The University of Texas at Austin ("U. T. Austin").
# All rights reserved.
#
# By using this software the USER indicates that he or she has read,
# understood and will comply with the following:
#
# U. T. Austin hereby grants USER permission to use, copy, modify, and
# distribute this software and its documentation for any purpose and
# without fee, provided that:
#
# 1. the above copyright notice appears in all copies of the software
#    and its documentation, or portions thereof, and
# 2. a full copy of this notice is included with the software and its
#    documentation, or portions thereof, and
# 3. neither the software nor its documentation, nor portions thereof,
#    is sold for profit. Any commercial sale or license of this software,
#    copies of the software, its associated documentation and/or
#    modifications of either is strictly prohibited without the prior
#    consent of U. T. Austin.
#
# Title to copyright to this software and its associated documentation
# shall at all times remain with U. T. Austin. No right is granted to
# use in advertising, publicity or otherwise any trademark, service
# mark, or the name of U. T. Austin.
#
# This software and any associated documentation are provided "as is,"
# and U. T. AUSTIN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESSED OR
# IMPLIED, INCLUDING THOSE OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
# PURPOSE, OR THAT USE OF THE SOFTWARE, MODIFICATIONS, OR ASSOCIATED
# DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS OR
# OTHER INTELLECTUAL PROPERTY RIGHTS OF A THIRD PARTY. U. T. Austin, The
# University of Texas System, its Regents, officers, and employees shall
# not be liable under any circumstances for any direct, indirect, special,
# incidental, or consequential damages with respect to any claim by USER
# or any third party on account of or arising from the use, or inability
# to use, this software or its associated documentation, even if U. T.
# Austin has been advised of the possibility of those damages.
#
# Submit commercialization requests to: Office of the Executive Vice
# President and Provost, U. T. Austin, 201 Main Bldg., Austin, Texas,
# 78712, ATTN: Technology Licensing Specialist.
#
# @(#)Jmakefile	1.9 07/16/98 (cc.utexas.edu)
#

#
# Makefile for npasswd passwd method library
# This library contains all the password database access method
# modules and the ONE selected shadow database access method module
#

#
# This file is auto-generated from Makefile.SH - all persistent
# changes should be made there.
#
# Makefile.SH is itself generated from "Jmakefile" by jmake.
#
# Jmakefile is included in the developer kit.
# See the Npasswd Support Guide (Support.html).
#

# Shadow module (from Configure via config.sh)

PASSWDM_SRC = \
	pwm_main.c \
	pwm_local.c \
	pwm_nis.c

SHADOWM_SRC = \
	shm_adjunct.c \
	shm_aix.c \
	shm_shadow.c \
	shm_ultrix.c \
	shm_osf1.c \
	shm_hpux.c

METHOD_OBJ = \
	pwm_main.o \
	pwm_local.o \
	pwm_nis.o 

#
# all
#  	Build passwd database access method library
#
## all:  	Build passwd database access method library

#
# libmethod.a
#  Build passwd database access method library
#
## libmethod.a:  Build passwd database access method library

all:: libmethod.a

local_realclean::
	$(RM) libmethod.a

libmethod.a:  $(METHOD_OBJ) $(SHADOW_M).o
	$(RM) $@
	$(AR) $@  $(METHOD_OBJ) $(SHADOW_M).o
	$(RANLIB) $@


passwdtab.h: passwdtab.h.SH
	@$(RM) passwdtab.h
	@sh passwdtab.h.SH

passwdtab.h.SH:
	@exit 0;


shadowtab.h: shadowtab.h.SH
	@$(RM) shadowtab.h
	@sh shadowtab.h.SH

shadowtab.h.SH:
	@exit 0;


# ---------------------------------------------------------------
# Set compile flags to build debug and test versions
# ---------------------------------------------------------------
include $(LOCAL_FLAGS)

#
# debug-none
# Set Makefile to build production binary
##_ debug-none: Set Makefile to build production binary
#
debug-none::
	@$(RM) -f $(LOCAL_FLAGS)
	@cp /dev/null $(LOCAL_FLAGS)
	@echo "Set flags in $(CURRENT) to build production binary (test off)"
	@echo "Do \"make realclean\" to remove old objects

#
# debug-dbx
#	Set Makefile to build debugger friendly binary)
##_ debug-dbx:	Set Makefile to build debugger friendly binary)
#
debug-dbx::
	@$(RM) -f $(LOCAL_FLAGS)
	@echo 'X_LOCAL_CFLAGS = ${X_CCDEBUG} -DCDEBUG=1' > ${LOCAL_FLAGS}
	@echo 'X_COPT='	>> ${LOCAL_FLAGS}
	@echo "Set flags in $(CURRENT) to build debugger friendly binary (test level 1)"
	@echo "Do \"make realclean\" to remove old objects

#
# debug-files
# Set Makefile to build binary which uses local files)
##_ debug-files: Set Makefile to build binary which uses local files
#
debug-files::
	@$(RM) -f $(LOCAL_FLAGS)
	@echo 'X_LOCAL_CFLAGS = ${X_CCDEBUG} -DCDEBUG=2' > $(LOCAL_FLAGS)
	@echo 'X_COPT=' >> $(LOCAL_FLAGS)
	@echo "Set flags in $(CURRENT) to build binary which uses local files (test level 2)"
	@echo "Do \"make realclean\" to remove old objects

#
# debug-system
#	Set Makefile to build non-production test binary
##_ debug-system:	Set Makefile to build non-production test binary
#
debug-system::
	@$(RM) -f $(LOCAL_FLAGS)
	@echo 'X_LOCAL_CFLAGS = ${X_CCDEBUG} -DCDEBUG=3' > $(LOCAL_FLAGS)
	@echo 'X_COPT='	>> $(LOCAL_FLAGS)
	@echo "Set flags in $(CURRENT) to build non-production test binary (test level 3)"
	@echo "Do \"make realclean\" to remove old objects

# Have "make depend" reset compile flags

depend::
	- at cp /dev/null $(LOCAL_FLAGS)

depend:: ../..//mkdep

../..//mkdep:
	@echo "You have to run Configure in $(TOP) first."; exit 1

depend::
	($(SED) '/^# DO NOT DELETE/q' Makefile && \
	$(MKDEP) $(SOURCES) | \
	$(SED) -e 's/: \.\//: /; s/\/usr\/include[^ ]*//g' -e '/: *$$/d' \
	) > Makefile.new
	cp Makefile Makefile.bak
	cp Makefile.new Makefile
	$(RM) Makefile.new

#
# lint
#  Check C sources with lint
#
## lint:  Check C sources with lint

lint:
	$(LINT) $(LINTFLAGS) $(SOURCES) $(LINTLIBS)

########################################################################
# Common rules for all Makefiles -- do not edit

emptyrule::

clean: local_clean
realclean: local_realclean
clobber: local_clobber

local_clean::
	$(RM) core *~ *.o

local_realclean:: local_clean

local_clobber:: local_realclean
	$(RM) Makefile config.sh

Makefile.SH: Jmakefile
	- at if test -f $(TOP)/.package; then \
	if test -f Makefile.SH; then \
	echo "	$(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~"; \
	$(RM) Makefile.SH~; $(MV) Makefile.SH Makefile.SH~; \
	fi; \
	echo "	$(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT)" ; \
	$(JMAKE) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT) ; \
	else exit 0; fi

Makefile: Makefile.SH
	/bin/sh Makefile.SH

Jmakefile:

tags::
	$(CTAGS) -w *.[ch]
	$(CTAGS) -xw *.[ch] > tags

local_clobber::
	$(RM) tags

########################################################################
# Empty rules for directories with no sub-directories -- do not edit

install::
	@echo "install in $(CURRENT) done."

deinstall::
	@echo "deinstall in $(CURRENT) done."

install.man::
	@echo "install.man in $(CURRENT) done."

deinstall.man::
	@echo "deinstall.man in $(CURRENT) done."

Makefiles::

Makefiles.SH::

########################################################################
# Dependencies generated by make depend
# DO NOT DELETE THIS LINE -- make depend relies on it

# Put nothing here or make depend will gobble it up
.FORCE_DEPEND::
	@echo "You must run 'make depend' in $(TOP) first."; exit 1


More information about the freebsd-questions mailing list