# # Makefile.c # # Instructions: # # 1. At the UNIX prompt (%), type 'cp Makefile.c Makefile'. # 2. Edit Makefile using vi or emacs: # a. rename target, if desired # b. add list of source files at SRCS = ... # 3. % touch Makefile.dep # 4. % make depend # 5. % make # TARGET = readdata CC = gcc CFLAGS = -Wall -O INCLDIRS = SRCS = main.c OBJS = ${SRCS:.c=.o} $(TARGET): $(OBJS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(INCLDIRS) $(OBJS): $(CC) $(CFLAGS) $(INCLDIRS) -c $*.c depend: $(CC) -MM $(SRCS) $(INCLDIRS) > Makefile.dep clean: rm -f $(OBJS) core veryclean: clean rm -f $(TARGET) a.out include Makefile.dep