root/trunk/sam3/makefile.mif

Revision 1, 2.9 kB (checked in by jvw, 3 years ago)

Initial check-in for TxWin? version 1.02 sources

Line 
1#
2# Template makefile, to build with 32-bit compiler; many different targets!
3#
4# JvW 14-01-2004 Updated for the generic template build environment
5#
6# Usage: Include this from a subdirectory with a 'makefile' that set the
7#        various environmental variables like 'target_os' and 'target_env'
8
9# define main component name
10compo   = sam3
11
12cc = wcc386
13
14# allow (> 2 times) faster building by using the DLL versions from wmake
15!ifdef __LOADDLL__
16!  loaddll wcc386  wccd386
17!  loaddll wlink   wlink
18!  loaddll wlib    wlibd
19!endif
20
21!ifndef tx_version
22tx_version = _txall_
23!endif
24!ifneq tx_version _txall_
25cflags += -DTXMIN
26!endif
27
28txdir   = ..\..\..\txlib\$(tx_version)\lib
29txinc   = ..\..\..\txlib\include
30
31cflags += -bt=$(target_os) -ef -wx -zc -zp1 -zq
32lnkopt += option map option stack=128K libpath $(txdir)
33postfix =
34comprs  = rem
35
36!ifeq  target_env debug
37cflags += -d2
38#activate next line to remove trace from debug EXE (update txlib makefile too)
39#cflags += -DNOTRACE
40lnkopt += debug all
41postfix = d
42!else
43!ifeq  target_env trace
44postfix = t
45!else
46postfix = r
47#activate next line to remove ALL trace from EXE (not just from TXLIB)
48cflags += -DNOTRACE
49!endif
50#select optimization for the non-debug (t and r) versions
51cflags += -ormile
52!endif
53
54!ifeq target_os nt
55cflags += -bm -ei
56lnkopt += libpath $(%wintklib)
57bintype = win
58comprs  = upx --best
59!endif
60
61!ifeq target_os os2
62cflags += -bm
63lnkopt += libpath $(%os2tklib)
64bintype = os2
65comprs  = lxlite
66!endif
67
68!ifeq target_os linux
69lnkopt += libpath $(%lintklib)
70bintype = lin
71comprs  = upx --best
72!endif
73
74!ifeq target_os dos
75!ifeq target_sys dos32a
76bintype = dos
77!else
78bintype = dcw
79!endif
80comprs  = upx --best
81!endif
82
83gendep = makefile ..\..\makefile.mif
84
85.EXTENSIONS:
86.EXTENSIONS: .exe .lib .obj .c .h
87
88.c : ..\..
89.h : ..\..;$(txinc)
90
91.c.obj : .AUTODEPEND $(gendep)
92      $(cc) $[*.c $(cflags)
93
94exebase = ..\$(compo)$(bintype)
95exename = $(exebase)$(postfix).exe
96
97all : $(exename) .SYMBOLIC
98
99#list all object files to create a full dependancy list for the exe
100exedeps =                                                         &
101 $(compo).obj
102
103# add any objects and libraries needed beyond the component itself
104lnkspec =                                                         &
105 name      $(exename)                                             &
106 library tx$(bintype)$(postfix).lib                               &
107 file      $(compo)
108
109$(exename)   : $(exedeps) $(gendep) $(txdir)\tx$(bintype)$(postfix).lib
110      @%create $(compo).lnk
111      @%append $(compo).lnk system $(target_sys) $(lnkopt)
112      @%append $(compo).lnk $(lnkspec)
113      wlink $(lnkopt) @$(compo).lnk
114!ifeq  target_env debug
115!else
116      - $(comprs)  $^@
117!endif
118
119clean : .SYMBOLIC
120        @if exist *.obj del *.obj $(exename)
121        @if exist *.lnk del *.lnk
122        @if exist *.err del *.err
123        @if exist *.map del *.map
124        @if exist *.lst del *.lst
Note: See TracBrowser for help on using the browser.