~ubuntu-branches/ubuntu/lucid/graphviz/lucid-security

« back to all changes in this revision

Viewing changes to tools/sfio/Makefile.orig

  • Committer: Bazaar Package Importer
  • Author(s): Stephen M Moraco
  • Date: 2002-02-05 18:52:12 UTC
  • Revision ID: james.westby@ubuntu.com-20020205185212-8i04c70te00rc40y
Tags: upstream-1.7.16
ImportĀ upstreamĀ versionĀ 1.7.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# This makefile builds both uni-threaded and multi-threaded versions
 
2
# of the libraries. It can be used as:
 
3
#       1. make install
 
4
#               building both versions
 
5
#       2. make install_ut
 
6
#               building the uni-threaded version only
 
7
#       3. make install_mt
 
8
#               building the multi-threaded version only
 
9
#
 
10
# Written by Kiem-Phong Vo
 
11
 
 
12
LIBTYPE=
 
13
 
 
14
INCDIR= ../include
 
15
LIBDIR= ../lib
 
16
BINDIR= ../bin
 
17
 
 
18
# Compiler and flags to use
 
19
CXFLAGS=
 
20
CCMODE= -O
 
21
CCFLAGS= -I. $(CCMODE) $(LIBTYPE) $(CXFLAGS)
 
22
AR=     ar
 
23
CC=     cc
 
24
 
 
25
# sfio
 
26
SRCS=   sfclose.c sfclrlock.c sfcvt.c sfdisc.c sfdlen.c sfexcept.c \
 
27
        sfextern.c sffilbuf.c sfflsbuf.c sfprints.c sfgetd.c sfgetl.c \
 
28
        sfgetr.c sfgetu.c sfllen.c sfmode.c sfmove.c sfnew.c \
 
29
        sfnotify.c sfnputc.c sfopen.c sfpkrd.c sfpool.c sfpopen.c \
 
30
        sfprintf.c sfputd.c sfputl.c sfputr.c sfputu.c sfrd.c sfread.c \
 
31
        sfscanf.c sfseek.c sfset.c sfsetbuf.c sfsetfd.c sfsize.c sfsk.c \
 
32
        sfstack.c sfstrtod.c sfsync.c sftable.c sftell.c sftmp.c \
 
33
        sfungetc.c sfvprintf.c sfvscanf.c sfwr.c sfwrite.c sfexit.c \
 
34
        sfpurge.c sfpoll.c sfreserve.c sfswap.c sfraise.c sfmutex.c \
 
35
        sfgetm.c sfputm.c sfresize.c
 
36
OBJS=   sfclose.o sfclrlock.o sfcvt.o sfdisc.o sfdlen.o sfexcept.o \
 
37
        sfextern.o sffilbuf.o sfflsbuf.o sfprints.o sfgetd.o sfgetl.o \
 
38
        sfgetr.o sfgetu.o sfllen.o sfmode.o sfmove.o sfnew.o \
 
39
        sfnotify.o sfnputc.o sfopen.o sfpkrd.o sfpool.o sfpopen.o \
 
40
        sfprintf.o sfputd.o sfputl.o sfputr.o sfputu.o sfrd.o sfread.o \
 
41
        sfscanf.o sfseek.o sfset.o sfsetbuf.o sfsetfd.o sfsize.o sfsk.o \
 
42
        sfstack.o sfstrtod.o sfsync.o sftable.o sftell.o sftmp.o \
 
43
        sfungetc.o sfvprintf.o sfvscanf.o sfwr.o sfwrite.o sfexit.o \
 
44
        sfpurge.o sfpoll.o sfreserve.o sfswap.o sfraise.o sfmutex.o \
 
45
        sfgetm.o sfputm.o sfresize.o
 
46
 
 
47
# function versions of macros
 
48
SFIO_F= Sfio_f/_sfclrerr.o Sfio_f/_sfdlen.o Sfio_f/_sfeof.o \
 
49
        Sfio_f/_sferror.o Sfio_f/_sffileno.o Sfio_f/_sfgetc.o \
 
50
        Sfio_f/_sfllen.o Sfio_f/_sfputc.o Sfio_f/_sfputd.o \
 
51
        Sfio_f/_sfputl.o Sfio_f/_sfputm.o Sfio_f/_sfputu.o \
 
52
        Sfio_f/_sfslen.o Sfio_f/_sfstacked.o Sfio_f/_sfulen.o \
 
53
        Sfio_f/_sfvalue.o
 
54
 
 
55
# stdio-source compatibility code
 
56
STDIO_S=Stdio_s/stdfgetc.o Stdio_s/stdfprintf.o Stdio_s/stdfputc.o \
 
57
        Stdio_s/stdfscanf.o Stdio_s/stdgetc.o Stdio_s/stdgets.o \
 
58
        Stdio_s/stdgetw.o Stdio_s/stdfdopen.o Stdio_s/stdprintf.o \
 
59
        Stdio_s/stdputc.o Stdio_s/stdputw.o Stdio_s/stdscanf.o \
 
60
        Stdio_s/stdsprintf.o Stdio_s/stdsetvbuf.o Stdio_s/stdtmpfile.o \
 
61
        Stdio_s/stdfopen.o Stdio_s/stdpopen.o Stdio_s/stdfreopen.o \
 
62
        Stdio_s/stdfwrite.o Stdio_s/stdfread.o Stdio_s/stdfflush.o
 
63
 
 
64
# Thread-safety
 
65
MTSAFE= ../vthread/vtextern.o ../vthread/vtmtxclrlock.o \
 
66
        ../vthread/vtmtxclose.o ../vthread/vtmtxlock.o \
 
67
        ../vthread/vtmtxopen.o ../vthread/vtmtxtrylock.o \
 
68
        ../vthread/vtmtxunlock.o ../vthread/vtonce.o
 
69
 
 
70
# IO disciplines
 
71
SFIO_DC=Sfio_dc/sfdcdio.o Sfio_dc/sfdcdos.o Sfio_dc/sfdcfilter.o \
 
72
        Sfio_dc/sfdclzw.o Sfio_dc/sfdcseekable.o Sfio_dc/sfdcslow.o \
 
73
        Sfio_dc/sfdcsubstream.o Sfio_dc/sfdctee.o Sfio_dc/sfdcunion.o
 
74
 
 
75
.c.o:
 
76
        $(CC) -c $(CCFLAGS) $*.c
 
77
 
 
78
# only one of the below install targets should be uncommented
 
79
#install: install_ut
 
80
#install: vthread install_mt
 
81
install: vthread install_mt install_ut
 
82
 
 
83
# this target builds the Vthread library
 
84
vthread:
 
85
        cd ../vthread; $(MAKE) SHELL="$(SHELL)" CC="$(CC)" \
 
86
                CCMODE="$(CCMODE)" CXFLAGS="$(CXFLAGS)" install
 
87
 
 
88
# this target builds the uni-threaded version of Sfio
 
89
install_ut:
 
90
        echo""; echo "BUILDING UNI-THREADED libsfio.a"
 
91
        $(SHELL) ./Makestate.sh unithreaded
 
92
        $(MAKE) LIBTYPE="-Dvt_threaded=0" SHELL="$(SHELL)" CC="$(CC)" \
 
93
                CCMODE="$(CCMODE)" CXFLAGS="$(CXFLAGS)" install_unithreaded
 
94
 
 
95
# this target builds the multi-threaded version of Sfio
 
96
install_mt:
 
97
        echo""; echo "BUILDING MULTI-THREADED libsfio-mt.a";
 
98
        $(SHELL) ./Makestate.sh multithreaded
 
99
        $(MAKE) LIBTYPE="-Dvt_threaded=1" SHELL="$(SHELL)" CC="$(CC)" \
 
100
                CCMODE="$(CCMODE)" CXFLAGS="$(CXFLAGS)" install_multithreaded
 
101
 
 
102
install_unithreaded: libsfio.a libstdio.a
 
103
        cp sfio.h ast_common.h sfio_t.h Stdio_s/stdio.h Sfio_dc/sfdisc.h $(INCDIR)
 
104
        cp libsfio.a $(LIBDIR)
 
105
        -(ranlib $(LIBDIR)/libsfio.a; exit 0) >/dev/null 2>&1
 
106
        cp Stdio_b/libstdio.a $(LIBDIR)
 
107
        -(ranlib $(LIBDIR)/libstdio.a; exit 0) >/dev/null 2>&1
 
108
 
 
109
libsfio.a: ast_common.h FEATURE/sfio $(OBJS) mksfio_f mkstdio_s mksfio_dc
 
110
        $(AR) cr libsfio.a $(OBJS) $(SFIO_F) $(STDIO_S) $(SFIO_DC)
 
111
        -(ranlib libsfio.a; exit 0) >/dev/null 2>&1
 
112
 
 
113
libstdio.a:
 
114
        cd Stdio_b; $(MAKE) LIBTYPE="$(LIBTYPE)" SHELL="$(SHELL)" CC="$(CC)" \
 
115
                CCMODE="$(CCMODE)" CXFLAGS="$(CXFLAGS)" libstdio.a
 
116
 
 
117
install_multithreaded: libsfio-mt.a libstdio-mt.a
 
118
        cp sfio.h ast_common.h sfio_t.h Stdio_s/stdio.h Sfio_dc/sfdisc.h $(INCDIR)
 
119
        cp libsfio-mt.a $(LIBDIR)
 
120
        -(ranlib $(LIBDIR)/libsfio-mt.a; exit 0) >/dev/null 2>&1
 
121
        cp Stdio_b/libstdio-mt.a $(LIBDIR)
 
122
        -(ranlib $(LIBDIR)/libstdio-mt.a; exit 0) >/dev/null 2>&1
 
123
 
 
124
libsfio-mt.a: ast_common.h FEATURE/sfio $(OBJS) mksfio_f mkstdio_s mksfio_dc
 
125
        $(AR) cr libsfio-mt.a $(OBJS) $(SFIO_F) $(STDIO_S) $(SFIO_DC) $(MTSAFE)
 
126
        -(ranlib libsfio-mt.a; exit 0) >/dev/null 2>&1
 
127
 
 
128
libstdio-mt.a:
 
129
        cd Stdio_b; $(MAKE) LIBTYPE="$(LIBTYPE)" SHELL="$(SHELL)" CC="$(CC)" \
 
130
                CCMODE="$(CCMODE)" CXFLAGS="$(CXFLAGS)" libstdio-mt.a
 
131
 
 
132
# the make goals below are common to both uni&multi-threaded versions
 
133
FEATURE/sfio: features/sfio
 
134
        $(BINDIR)/iffe set cc $(CC) $(CCFLAGS) : run features/sfio
 
135
ast_common.h: features/common
 
136
        $(BINDIR)/iffe - set cc $(CC) $(CCFLAGS) : run features/common > ast_common.h
 
137
mksfio_f:
 
138
        cd Sfio_f; $(MAKE) LIBTYPE="$(LIBTYPE)" SHELL="$(SHELL)" CC="$(CC)" \
 
139
                CCMODE="$(CCMODE)" CXFLAGS="$(CXFLAGS)"
 
140
mkstdio_s:
 
141
        cd Stdio_s; $(MAKE) LIBTYPE="$(LIBTYPE)" SHELL="$(SHELL)" CC="$(CC)" \
 
142
                CCMODE="$(CCMODE)" CXFLAGS="$(CXFLAGS)"
 
143
mksfio_dc:
 
144
        cd Sfio_dc; $(MAKE) LIBTYPE="$(LIBTYPE)" SHELL="$(SHELL)" CC="$(CC)" \
 
145
                CCMODE="$(CCMODE)" CXFLAGS="$(CXFLAGS)"
 
146
 
 
147
clean:
 
148
        -(rm -rf FEATURE $(OBJS) ast_common.h Makefile.state; exit 0) >/dev/null 2>&1
 
149
        -(rm libsfio.a libstdio.a libsfio-mt.a libstdio-mt.a; exit 0) >/dev/null 2>&1
 
150
        cd Sfio_f; $(MAKE) SHELL="$(SHELL)" clean
 
151
        cd Stdio_s; $(MAKE) SHELL="$(SHELL)" clean
 
152
        cd Stdio_b; $(MAKE) SHELL="$(SHELL)" clean
 
153
        cd Sfio_dc; $(MAKE) SHELL="$(SHELL)" clean