Chinaunix首页 | 论坛 | 博客
  • 博客访问: 612462
  • 博文数量: 239
  • 博客积分: 7941
  • 博客等级: 准将
  • 技术积分: 2467
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-10 12:14
个人简介

及时当勉励

文章分类

全部博文(239)

文章存档

2013年(29)

2011年(22)

2010年(188)

分类:

2010-04-13 23:02:05

# Makefile for cslib/standard directory
# Last modified on Thu Oct 20 13:49:04 1994 by eroberts
#****************************************************************

OBJECTS = \
    genlib.o \
    exception.o \
    strlib.o \
    simpio.o \
    random.o \
    graphics.o

CSLIB = cslib.a

CC = gcc
CFLAGS = -g -I. $(CCFLAGS)

# ***************************************************************
# Entry to bring the package up to date
#    The "make all" entry should be the first real entry

all: $(CSLIB) gccx

# ***************************************************************
# Standard entries to remove files from the directories
#    tidy    -- eliminate unwanted files
#    clean   -- delete derived files in preparation for rebuild
#    scratch -- synonym for clean

tidy:
    rm -f ,* .,* *~ core a.out *.err

clean scratch: tidy
    rm -f *.o *.a gccx

# ***************************************************************
# C compilations

genlib.o: genlib.c genlib.h exception.h gcalloc.h
    $(CC) $(CFLAGS) -c genlib.c

exception.o: exception.c exception.h genlib.h
    $(CC) $(CFLAGS) -c exception.c

strlib.o: strlib.c strlib.h genlib.h
    $(CC) $(CFLAGS) -c strlib.c

simpio.o: simpio.c simpio.h strlib.h genlib.h
    $(CC) $(CFLAGS) -c simpio.c

graphics.o: graphics.c graphics.h genlib.h
    $(CC) $(CFLAGS) -c graphics.c

random.o: random.c random.h genlib.h
    $(CC) $(CFLAGS) -c random.c

# ***************************************************************
# Entry to reconstruct the library archive

$(CSLIB): $(OBJECTS)
    -rm -f $(CSLIB)
    ar cr $(CSLIB) $(OBJECTS)
    ranlib $(CSLIB)

# ***************************************************************
# Entry to reconstruct the gccx script

gccx: Makefile
    @echo '#! /bin/csh -f' > gccx
    @echo 'set INCLUDE =' `pwd` >> gccx
    @echo 'set CSLIB = $$INCLUDE/cslib.a' >> gccx
    @echo 'set LIBRARIES = ($$CSLIB -lm)' >> gccx
    @echo 'foreach x ($$*)' >> gccx
    @echo '  if ("x$$x" == "x-c") then' >> gccx
    @echo '    set LIBRARIES = ""' >> gccx
    @echo '    break' >> gccx
    @echo '  endif' >> gccx
    @echo 'end' >> gccx
    @echo 'gcc -g -I$$INCLUDE $$* $$LIBRARIES' >> gccx
    @chmod a+x gccx
    @echo '[gccx script created]'
 

阅读(580) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~