Mail Archives: djgpp/1996/12/28/23:19:04
-- [ From: John Lathrop * EMC.Ver #2.5.02 ] --
Hello,
I'm new to djgpp and makefiles. I've been using the makefile at the bottom
of this message as a learning example. I can follow this through completely
but I have several questions (problems) that I hope someone can answer.
1. libtap.a is created by the following:
libtap.a : $(UTIL_OBJS)
ar -r $@ $^
but, I get the message "d:/djgpp/bin\ld.exe: cannot open -ltap: No such file
or directory (ENOENT)". Nevertheless, everything works when I copy libtap.a
to d:/djgpp/lib/.
2. Related to the above problem, isn't the following supposed to force a
search of the current directory for libtap.a:
L_PARAMS=-Wall -I./ $(DEBUG) -o
exec/%.exe : objs/%.o libtap.a
gcc $(L_PARAMS) $@ $< -lalleg -ltap
*************The Makefile Follows*****************
UTIL_OBJS=objs/any_rect.o objs/ugouraud.o objs/map_bmp.o \
objs/ushsetup.o objs/shade_r.o objs/over_bmp.o \
objs/overrect.o
OBJS=objs/tengine.o objs/tg.o objs/tshade.o objs/tover.o \
objs/makeshad.o objs/makedat.o
OPTIM=-m486 -O6
#OPTIM=-O
#DEBUG=-g
DEBUG=-s
#DEBUG=-pg
C_PARAMS=-Wall -I./include/ $(DEBUG)
L_PARAMS=-Wall -I./ $(DEBUG) -o
all : dirs objs engine lib gouraud shade over maker
dirs :
md exec
md objs
compress : exec/tg.exe exec/tengine.exe exec/tshade.exe \
exec/tover.exe exec/makeshad.exe exec/makedat.exe
djp $^
objs : $(OBJS) $(UTIL_OBJS)
lib : libtap.a
gouraud : exec/tg.exe
shade : exec/tshade.exe
engine : exec/tengine.exe
over : exec/tover.exe
maker : exec/makedat.exe exec/makeshad.exe
exec/makedat.exe : objs/makedat.o
gcc $(L_PARAMS) exec/makedat.exe objs/makedat.o -lalleg
exec/makedat
move test.dat exec
exec/makeshad.exe : objs/makeshad.o libtap.a
gcc $(L_PARAMS) exec/makeshad.exe objs/makeshad.o -ltap -lalleg
exec/makeshad
move tables.dat exec
exec/%.exe : objs/%.o libtap.a
gcc $(L_PARAMS) $@ $< -lalleg -ltap
objs/%.o : src/%.c
gcc -c $^ -o $@ $(C_PARAMS) $(OPTIM)
libtap.a : $(UTIL_OBJS)
ar -r $@ $^
--
****************************************************
John Lathrop
http://www.elite.net/~lathropj/
- Raw text -