books/apitue/sample-code/05/make-examples/Makefile.2

20 lines
510 B
Groff

# A slightly better Makefile. As the first one, but much shorter, since
# we're using the various built-in rules and definitions in make(1).
PROG= ls
OBJS= cmp.o ls.o main.o print.o stat_flags.o util.o
# If commented out, defaults will be used. If uncommented, these values
# will be used, even though there is no other explicit mention of this
# variable in this Makefile.
#CFLAGS= -Wall -g
all: ${PROG}
${PROG}: ${OBJS}
@echo $@ depends on $?
${CC} ${LDFLAGS} ${OBJS} -o ${PROG}
clean:
rm -f ls *.o