| 1 | #
|
|---|
| 2 | # TXLIB master makefile, to build with 32-bit compiler; many different targets
|
|---|
| 3 | #
|
|---|
| 4 | # JvW 06-06-2002 Initial version, derived from WATCOM JvW TEST project
|
|---|
| 5 | # JvW 13-04-2003 Updated to use AUTODEPEND for .h includes
|
|---|
| 6 | # JvW 15-01-2004 Use consistent r/d/t postfixes for the 3 variants
|
|---|
| 7 | # JvW 04-03-2004 Moved includes to ..\include and libs to ..\lib, added Linux
|
|---|
| 8 | # JvW 02-12-2004 Moved targets to 2nd level subdir, for OEM/special versions
|
|---|
| 9 | # JvW 24-07-2005 Moved LZW and REG modules to DFSee specific (no open source)
|
|---|
| 10 | # JvW 24-07-2005 Split some sources to improve modularity (smaller executables)
|
|---|
| 11 | #
|
|---|
| 12 | # Usage: Include this from 2nd level subdirectory with a 'makefile' that set the
|
|---|
| 13 | # various environmental variables like 'target_os' and 'target_env'
|
|---|
| 14 |
|
|---|
| 15 | # define main component name (not an EXE here but a LIB)
|
|---|
| 16 | compo = tx
|
|---|
| 17 |
|
|---|
| 18 | cc = wcc386
|
|---|
| 19 |
|
|---|
| 20 | # allow (> 2 times) faster building by using the DLL versions from wmake
|
|---|
| 21 | !ifdef __LOADDLL__
|
|---|
| 22 | ! loaddll wcc386 wccd386
|
|---|
| 23 | ! loaddll wlink wlink
|
|---|
| 24 | ! loaddll wlib wlibd
|
|---|
| 25 | !endif
|
|---|
| 26 |
|
|---|
| 27 | !ifndef tx_version
|
|---|
| 28 | tx_version = _txall_
|
|---|
| 29 | !endif
|
|---|
| 30 | !ifneq tx_version _txall_
|
|---|
| 31 | cflags += -DTXMIN
|
|---|
| 32 | !endif
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 | txinc = ..\..\include
|
|---|
| 36 |
|
|---|
| 37 | cflags += -bt=$(target_os) -ef -wx -zc -zp1 -zq
|
|---|
| 38 | libopt += -b -n
|
|---|
| 39 | postfix =
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 | !ifeq target_env debug
|
|---|
| 43 | cflags += -d2
|
|---|
| 44 | #activate next line to remove trace from debug EXE (update dfsee makefile too)
|
|---|
| 45 | #cflags += -DNOTRACE
|
|---|
| 46 | lnkopt += debug all
|
|---|
| 47 | postfix = d
|
|---|
| 48 | !else
|
|---|
| 49 | cflags += -d1
|
|---|
| 50 | lnkopt += option symfile
|
|---|
| 51 | !ifeq target_env trace
|
|---|
| 52 | postfix = t
|
|---|
| 53 | !else
|
|---|
| 54 | postfix = r
|
|---|
| 55 | cflags += -DNOTRACE
|
|---|
| 56 | !endif
|
|---|
| 57 | #select optimization for the non-debug (t and r) versions
|
|---|
| 58 | !ifeq target_os linux
|
|---|
| 59 | cflags += -ormile
|
|---|
| 60 | !else
|
|---|
| 61 | cflags += -oneasx
|
|---|
| 62 | !endif
|
|---|
| 63 | !endif
|
|---|
| 64 |
|
|---|
| 65 | !ifeq target_os nt
|
|---|
| 66 | cflags += -bm -ei
|
|---|
| 67 | lnkopt += libpath $(%wintklib)
|
|---|
| 68 | bintype = win
|
|---|
| 69 | !endif
|
|---|
| 70 |
|
|---|
| 71 | !ifeq target_os os2
|
|---|
| 72 | cflags += -bm
|
|---|
| 73 | lnkopt += libpath $(%os2tklib)
|
|---|
| 74 | bintype = os2
|
|---|
| 75 | !endif
|
|---|
| 76 |
|
|---|
| 77 | !ifeq target_os linux
|
|---|
| 78 | lnkopt += libpath $(%lintklib)
|
|---|
| 79 | bintype = lin
|
|---|
| 80 | !endif
|
|---|
| 81 |
|
|---|
| 82 | !ifeq target_os dos
|
|---|
| 83 | !ifeq target_sys dos32a
|
|---|
| 84 | bintype = dos
|
|---|
| 85 | !else
|
|---|
| 86 | cflags += -DCAUSEWAY
|
|---|
| 87 | bintype = dcw
|
|---|
| 88 | !endif
|
|---|
| 89 | !endif
|
|---|
| 90 |
|
|---|
| 91 | gendep = makefile ..\..\makefile.mif
|
|---|
| 92 |
|
|---|
| 93 | .EXTENSIONS:
|
|---|
| 94 | .EXTENSIONS: .exe .lib .obj .c .h
|
|---|
| 95 |
|
|---|
| 96 | .c : ..\..
|
|---|
| 97 | .h : ..\..;$(txinc)
|
|---|
| 98 |
|
|---|
| 99 | .c.obj : .AUTODEPEND $(gendep)
|
|---|
| 100 | $(cc) $[*.c $(cflags)
|
|---|
| 101 |
|
|---|
| 102 | libbase = ..\lib\$(compo)$(bintype)
|
|---|
| 103 | libname = $(libbase)$(postfix).lib
|
|---|
| 104 |
|
|---|
| 105 | all : $(libname) .SYMBOLIC
|
|---|
| 106 |
|
|---|
| 107 | #list all object files to create a full dependancy list for the lib
|
|---|
| 108 | libdeps = &
|
|---|
| 109 | txlib.obj txparse.obj txparse2.obj txboot.obj txcrc32.obj &
|
|---|
| 110 | txcon.obj txcon2.obj txcon3.obj txcrclvm.obj &
|
|---|
| 111 | txextcmd.obj txlogfil.obj txscript.obj txafail.obj &
|
|---|
| 112 | txfsys.obj txunico.obj txfiles.obj txwildc.obj txcrite.obj &
|
|---|
| 113 | txfexist.obj txfpath.obj txmpath.obj txtname.obj txwiop.obj &
|
|---|
| 114 | txstdcmd.obj txtrace.obj txtrace2.obj txtree.obj txutil.obj &
|
|---|
| 115 | txstring.obj txosver.obj txstrlst.obj txstrtxt.obj txstrnum.obj &
|
|---|
| 116 | txfsattr.obj txosapi.obj txstrsiz.obj txswap.obj txdisp.obj &
|
|---|
| 117 | txfmtmix.obj txmemstr.obj txfname.obj txfnext.obj
|
|---|
| 118 |
|
|---|
| 119 | # list all objects to be part of the library
|
|---|
| 120 | libspec = &
|
|---|
| 121 | +txlib +txparse +txparse2 +txboot +txcrc32 &
|
|---|
| 122 | +txcon +txcon2 +txcon3 +txcrclvm &
|
|---|
| 123 | +txextcmd +txlogfil +txscript +txafail &
|
|---|
| 124 | +txfsys +txunico +txfiles +txwildc +txcrite &
|
|---|
| 125 | +txfexist +txfpath +txmpath +txtname +txwiop &
|
|---|
| 126 | +txstdcmd +txtrace +txtrace2 +txtree +txutil &
|
|---|
| 127 | +txstring +txosver +txstrlst +txstrtxt +txstrnum &
|
|---|
| 128 | +txfsattr +txosapi +txstrsiz +txswap +txdisp &
|
|---|
| 129 | +txfmtmix +txmemstr +txfname +txfnext
|
|---|
| 130 |
|
|---|
| 131 | # define the windowing stuff conditionally
|
|---|
| 132 | !ifeq tx_version txmin
|
|---|
| 133 | windeps=
|
|---|
| 134 | winspec=
|
|---|
| 135 | !else
|
|---|
| 136 | windeps= &
|
|---|
| 137 | txwdraw.obj txwhelp.obj txwikey.obj txwind.obj txwutil.obj &
|
|---|
| 138 | txwprint.obj txwproc.obj txwstdlg.obj txwidget.obj txselist.obj &
|
|---|
| 139 | txwmsg.obj txwehook.obj txwhexed.obj
|
|---|
| 140 | winspec= &
|
|---|
| 141 | +txwdraw +txwhelp +txwikey +txwind +txwutil &
|
|---|
| 142 | +txwprint +txwproc +txwstdlg +txwidget +txselist &
|
|---|
| 143 | +txwmsg +txwehook +txwhexed
|
|---|
| 144 | !endif
|
|---|
| 145 |
|
|---|
| 146 | $(libname) : $(gendep) $(libdeps) $(windeps)
|
|---|
| 147 | @%create $(compo).lbc
|
|---|
| 148 | @%append $(compo).lbc $(libname)
|
|---|
| 149 | @%append $(compo).lbc $(libspec) $(winspec)
|
|---|
| 150 | wlib $(libopt) @$(compo).lbc
|
|---|
| 151 |
|
|---|
| 152 | nolib : .SYMBOLIC
|
|---|
| 153 | @if exist $(libname) del $(libname)
|
|---|
| 154 | @if exist *.obj del *.obj
|
|---|
| 155 | @if exist *.lbc del *.lbc
|
|---|
| 156 | @if exist *.err del *.err
|
|---|
| 157 | @if exist *.lst del *.lst
|
|---|
| 158 | @if exist *.map del *.map
|
|---|
| 159 |
|
|---|
| 160 | clean : .SYMBOLIC
|
|---|
| 161 | @if exist *.obj del *.obj
|
|---|
| 162 | @if exist *.lbc del *.lbc
|
|---|
| 163 | @if exist *.err del *.err
|
|---|
| 164 | @if exist *.lst del *.lst
|
|---|
| 165 | @if exist *.map del *.map
|
|---|