www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/11/25/08:32:57

Xref: news-dnh.mv.net comp.os.msdos.djgpp:3422
Path: news-dnh.mv.net!mv!barney.gvi.net!news.netrail.net!imci2!newsfeed.internetmci.com!info.ucla.edu!ihnp4.ucsd.edu!sdcc12.ucsd.edu!sdcc15!wtanksle
From: wtanksle AT sdcc15 DOT ucsd DOT edu (William Tanksley)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: makedepend program ??
Date: Fri, 24 Nov 1995 21:27:01 -0500
Organization: University of California, San Diego
Lines: 67
References: <DI739q DOT 3w2 AT jade DOT mv DOT net>
Nntp-Posting-Host: sdcc15.ucsd.edu
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

dj AT delorie DOT com (DJ Delorie) wrote to us all:
>> I'm using djgpp for years, and I'm learning U..X system at my office. So I
>> discovered the wonderfull makedepend program.

>gcc has a much more powerful feature.  In your Makefile, add the "-MD"
>or "-MMD" options to gcc.  Then, add this at the end of your Makefile:

>	DEPS := $(wildcard *.d)
>	ifneq ($(DEPS),)
>	include $(DEPS)
>	endif

I tried adding this verbatim, and found that it didn't work at all (it
appeared to attach itself to the last rule defined, which in my case was
"clean").  So I removed the tabs, and it seemed to work, until I tried to
make a second time (that's always the big test).  I gave a big error then:
birth.d:1: *** multiple target patterns.  Stop.

I can't seem to figure it out, and I would really like this, since this is a
fairly large project and I'm compiling it fairly often.

>DJ

-Billy
Well, the makefile isn't that big-- here it is.  It's for Angband 2.7.9, by
the way.

# File: Makefile.ibm

# Purpose: Makefile support for "main-ibm.c"

# Note: Rename to "Makefile" before using


OBJS = \
  main-ibm.o main.o \
  signals.o util.o io.o init.o save.o save-old.o files.o \
  generate.o birth.o melee.o dungeon.o store.o \
  effects.o cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o \
  misc.o monster.o mon-desc.o object.o obj-desc.o \
  spells1.o spells2.o cave.o tables.o variable.o \
  term.o random.o z-util.o z-virt.o z-form.o wizard.o


CC = gcc
CFLAGS = -Wall -O2 -DUSE_IBM -s -MD
LIBS = -lpc
BINARY = angband.386

angband.exe:	$(BINARY)
		strip $(BINARY)
		coff2exe -s c:/djgcc/bin/go32.exe $(BINARY)

$(BINARY):	$(OBJS)
		$(CC) $(CFLAGS) -o $(BINARY) $(OBJS) $(LIBS)

clean:
	del *.o
	del angband.386

#.c.o:
#	$(CC) $(CFLAGS) -c $*.c

DEPS := $(wildcard *.d)
ifneq ($(DEPS),)
include $(DEPS)
endif

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019