root/trunk/sam1/makefile.mif

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