160ff8e62a9d1cf9aee402cab2d43e690903f9b4
[oweals/cde.git] / cde / config / cf / scoLib.rules
1 XCOMM $XConsortium: scoLib.rules /main/2 1996/09/28 16:12:20 rws $
2
3 /*
4  * SharedLibraryTarget3 - generate rules to create a shared library;
5  * build it into a different name so that we do not hose people by having
6  * the library gone for long periods.  
7  *
8  * Work around SCO sh environment size problem.
9  */
10 #ifndef SharedLibraryTarget3
11 #define SharedLibraryTarget3(libname,rev,solist1,solist2,solist3,down,up)       @@\
12 AllTarget(Concat(lib,libname.so.rev))                                   @@\
13                                                                         @@\
14 Concat(lib,libname.so.rev): solist1 solist2 solist3 $(EXTRALIBRARYDEPS) @@\
15         $(RM) $@~                                                       @@\
16         echo -n $(LD) -o up/$@~ $(SHLIBLDFLAGS) -h $@ solist1 " " > Concat(down/lib,cmd)        @@\
17         echo -n solist2 " " >> Concat(down/lib,cmd)                     @@\
18         echo -n solist3  >> Concat(down/lib,cmd)                        @@\
19         (cd down; $(SHELL) Concat(./lib,cmd))                           @@\
20         $(RM) $@ Concat(lib,tmp1) Concat(lib,tmp2)                      @@\
21         $(MV) $@~ $@                                                    @@\
22         $(RM) Concat(lib,libname.so)                                    @@\
23         $(LN) $@ Concat(lib,libname.so)                                 @@\
24         LinkBuildLibrary($@)                                            @@\
25         LinkBuildLibrary(Concat(lib,libname.so))                        @@\
26                                                                         @@\
27 clean::                                                                 @@\
28         $(RM) Concat(lib,libname.so.rev) Concat(lib,libname.so)
29
30 #endif /* SharedLibraryTarget */
31
32 /*
33  * Redefine this so we can drop -b elf and build COFF objects for the
34  * archived library.  This assumes -b elf is hanging out in CCOPTIONS
35  */
36 #ifndef UnsharedLibObjCompile
37 #define UnsharedLibObjCompile(options) RemoveFile($@)                  @@\
38         ClearmakeOSName                                                  \
39         $(CC) -c $(CDEBUGFLAGS) $(THREADS_CFLAGS) $(ALLDEFINES) options $*.c @@\
40         $(MV) $@ unshared/$@
41 #endif
42