🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #14898

Re: Acerca del archivo makefile

#14898
From: J.A. Gutierrez
Date: Wed, 06 Sep 2000 13:51
112 lines
3886 bytes
Ivan Alameda Carballo <"iac(KitaEstoPaEscribirme)"@alphacom.es> wrote:

: MAS QUE UN MENSAJE DE NEWS PARECE UNA COMPETICION... porfa... podrias explicar
: como lo harias tu?  Yo tambien ando interesado, y me he leido el mensaje, y tu
	
	bueno, esta en
	8ooqvj$g5b$1@news.unizar.es

: mensaje, a la espera de hallar como tu lo harias en los puntos en los que
: discrepas... me haria falta que explicases como tu lo harias...

	Pues saltandose la parte del install:

-8<------------------------------------------------------------------------

CFLAGS=-O
CC = gcc
SRC = randsig.c

#
# construir la variable EXEC a partir de la SRC
#
EXEC = $(SRCS:.c=)


#
# regla implicita: para parar de foo.c a foo se hace 
# $(CC) $(CFLAGS) $< -o $@, donde $< es el target y $@ la dependencia
#
# Casualmente, coincide con la de por defecto, asi que se puede
# comentar.
#
####.c:
####	$(CC) $(CFLAGS) $< -o $@

# accion por defecto: construir $(EXEC)
all: $(EXEC)

# $(EXEC) depende de $(SRCS). El como se construye es implicito.
$(EXEC): $(SRCS)

# para hacer "make install" antes $(EXEC) tiene que estar actualizado.
install: $(EXEC)
	instalar y demas

-8<------------------------------------------------------------------------

	otro ejemplo de Makefile:
-8<------------------------------------------------------------------------

#CC		= cc $(DEFS)
CC		= gcc $(DEFS)
CFLAGS	= -O
#LD		= cc
LD		= gcc
AR		= ar vru
#RANLIB	= :
RANLIB	= ranlib

#DEFS	= -D_SOLARIS_ -DUFS -DMY_GETOPT
DEFS	= -D_SUNOS_ -DUFS -DMY_GETOPT

PROGRAM	= ufssh
LIB		= libufs.a
GETOPT  = getopt.o
LDFLAGS	= -L. -lufs

SRCS	= ufs_fs.c ufs_io.c ufs_db.c ufs_file.c
HDRS	= ufs_io.h sun_io.h sun_ufs.h ufs_db.h
FILES	= $(SRCS) $(HDRS) Makefile README ufssh.c ufs.c \
sunos/s_dklabel.h sunos/s_fs.h sunos/s_fsdir.h sunos/s_inode.h \
sunos/s_param.h sunos/s_types.h sunos/s_vnode.h

OBJS	= $(SRCS:.c=.o)
TAR		= ../ufslib.tgz

all: $(PROGRAM)

$(PROGRAM): ufssh.o $(LIB) $(GETOPT)
	$(LD) -o $@ ufssh.o $(GETOPT) $(LDFLAGS)

$(LIB):	$(OBJS)
	$(AR) $(LIB) $(OBJS)
	$(RANLIB) $(LIB)

clean:
	rm -f $(OBJS) core tags Makefile.bak

clobber: clean
	rm -f main ufs ufssh $(PROGRAM) $(LIB)
	
backup:	clobber $(TAR)

$(TAR):	$(FILES)
	rm -f $(TAR)
	gtar cvzf ../ufslib.tgz -C .. ufs

depend:
	makedepend -s "# DO NOT DELETE" -- $(CFLAGS) $(DEFS) -- $(SRCS)

tags:	$(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)


# DO NOT DELETE

-8<------------------------------------------------------------------------

-- 
PGP and other useless info at      \                 Oh, show us the way
http://www.cps.unizar.es/~spd/      \             to the next whisky bar
finger://daphne.cps.unizar.es/spd    \                      Weill/Bretch
es doloroso ser sabio y descubrir la sopa de ajo                   (Pla)
Technical Details
Message-ID: <8p5i4d$o9v$1@news.unizar.es>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-east!sn-xit-uk!supernews.com!193.162.153.122.MISMATCH!news.tele.dk!194.2.80.9!fr.usenet-edu.net!usenet-edu.net!jussieu.fr!news.rediris.es!news.unizar.es!not-for-mail
References: <39AE152B.F4333F14@uv.es> <slrn8qt70o.ms.sromero@compiler.dhis.org> <8oo1do$3pi$1@news.unizar.es> <39B5E644.654E2D46@alphacom.es>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII-7-bit
X-Google-Thread: f86c8,e82f0fb9d1fed054
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2000-09-06 06:49:09 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-east!sn-xit-uk!supernews.com!193.162.153.122.MISMATCH!news.tele.dk!194.2.80.9!fr.usenet-edu.net!usenet-edu.net!jussieu.fr!news.rediris.es!news.unizar.es!not-for-mail
From: "J.A. Gutierrez" <spd@daphne.cps.unizar.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Acerca del archivo makefile
Date: 6 Sep 2000 13:51:09 GMT
Organization: Rank
Lines: 112
Message-ID: <8p5i4d$o9v$1@news.unizar.es>
References: <39AE152B.F4333F14@uv.es> <slrn8qt70o.ms.sromero@compiler.dhis.org> <8oo1do$3pi$1@news.unizar.es> <39B5E644.654E2D46@alphacom.es>
NNTP-Posting-Host: daphne.cps.unizar.es
X-Trace: news.unizar.es 968248269 24895 155.210.152.20 (6 Sep 2000 13:51:09 GMT)
X-Complaints-To: usenet@news.unizar.es
NNTP-Posting-Date: 6 Sep 2000 13:51:09 GMT
User-Agent: tin/1.4.1-19991201 ("Polish") (UNIX) (IRIX/6.2 (IP22))