This makefile demonstrates some neat ways to generalize things which should make maintenance easier...

CC = gcc

SRCS = getopts.c
OBJS = $(SRCS:.c=.o)

LIBPATH = -L.
INCLS = -I.
CFLAGS = $(INCLS) -Wall -g
TARGET = coreutil

default: all

all:  $(TARGET)

$(OBJS): Makefile coreutil.h

$(TARGET): $(OBJS) $(TARGET).c
   $(CC) -o $(TARGET) $(TARGET).c $(OBJS) $(CFLAGS)

clean:
   $(RM) *.o $(TARGET) core

-- MattWalsh - 04 Apr 2002

Topic revision: r1 - 05 Apr 2002 - MattWalsh
 
This site is powered by the TWiki collaboration platformCopyright © 2008-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback