Ignore:
Timestamp:
Feb 8, 2003, 9:57:38 PM (23 years ago)
Author:
umoeller
Message:

Build updates, moved files from warpin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/makefile

    r245 r249  
    11#
    2 # makefile:
    3 #       makefile for src/helpers directory.
    4 #       For use with IBM NMAKE, which comes with the IBM compilers,
    5 #       the Developer's Toolkit, and the DDK.
     2# See make\readme.txt about an introduction to the make system introduced
     3# in the CVS trunk on 2003-01-28.
    64#
    7 #       This makefile is even more complicated than the other makefiles
    8 #       because the helpers code has been designed to be independent
    9 #       of any single project. Presently the helpers code is used in
    10 #       XWorkplace and WarpIN. As a result, I had to design a way so that
    11 #       this makefile can produce output in a variable directory, with
    12 #       variable compiler flags, and so on. This is done via environment
    13 #       variables passed in from the "parent" makefile of a specific
    14 #       project.
    15 #
    16 #       Even worse, with V0.9.5, I chose to create a shared runtime DLL
    17 #       for the various WarpIN executables. For that, I chose to use
    18 #       a separate makefile (makefile_dll). In order to share make
    19 #       definitions, these have been put into separate .in files in
    20 #       this directory, which are included via nmake !include.
    21 #
    22 #       Called from:    main makefile
    23 #
    24 #       Required environment variables:
    25 #
    26 #               -- PROJECT_BASE_DIR: where to find setup.in; this should
    27 #                   be the root directory of the project, e.g. "C:\cvs\warpin"
    28 #                   or "C:\cvs\xworkplace"
    29 #
    30 #               -- HELPERS_OUTPUT_DIR: where to create output files (*.obj, helpers.lib)
    31 #                   this should be a "bin" directory (e.g. "C:\cvs\warpin\bin"
    32 #
    33 #               -- CC_HELPERS: compiler command line for compiling C files.
    34 #                   With VAC++, this should include the /Ge+ (compile to EXE)
    35 #                   option to allow linking the library to both EXE and DLL
    36 #                   files.
    37 #                   If you're using the "dll" target, specify /Ge- instead.
    38 #
    39 #               -- MAINMAKERUNNING: if this is NOT defined, this makefile
    40 #                   will recurse to the makefile in $(PROJECT_BASE_DIR).
    41 #                   So to have this makefile run successfully, define this
    42 #                   variable to something.
    43 #
    44 #                   This variable was introduced to be able to start a build
    45 #                   process from src\helpers as well. However, when your own
    46 #                   project makefile calls src\helpers\makefile, you must set
    47 #                   this to something.
    48 #
    49 #       Input:          ./*.c
    50 #
    51 #       Targets:        specify the target(s) to be made, which can be:
    52 #
    53 #                       --  "all" (default): create helpers.lib in addition
    54 #                           to all the output .obj files in $(HELPERS_OUTPUT_DIR).
    55 #
    56 #                           This contains all helpers (plain C, control program,
    57 #                           and PM).
    58 #
    59 #                           This makes linking a bit easier since you don't have to
    60 #                           keep in mind the millions of object files. Still, you
    61 #                           should be sure to include the proper headers in your
    62 #                           code.
    63 #
    64 #                           Alternatively, you can call this makefile with certain
    65 #                           targets explicitly specified. However, you must then
    66 #                           make sure that the resulted object files are linked
    67 #                           properly, because some of the more advanced helpers
    68 #                           require other helpers.
    69 #
    70 #                       --  "plainc": create "plainc.lib", which contains
    71 #                           platform-independent helpers code only (no control
    72 #                           program helpers, no PM helpers).
    73 #
    74 #                           This is included if you specify "all". Use this if
    75 #                           you want a subset of the helpers only.
    76 #
    77 #                       --  "cp": create "cp.lib", which contains "plainc" plus
    78 #                           control program helpers.
    79 #
    80 #                           This is included if you specify "all". Use this if
    81 #                           you want a subset of the helpers only.
    82 #
    83 #       Edit "setup.in" to set up the make process.
     5#       Copyright (C) 1998-2003 Ulrich M”ller.
     6#       This file is part of the XWorkplace source package.
     7#       XWorkplace is free software; you can redistribute it and/or modify
     8#       it under the terms of the GNU General Public License as published
     9#       by the Free Software Foundation, in version 2 as it comes in the
     10#       "COPYING" file of the XWorkplace main distribution.
     11#       This program is distributed in the hope that it will be useful,
     12#       but WITHOUT ANY WARRANTY; without even the implied warranty of
     13#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14#       GNU General Public License for more details.
    8415#
    8516
    86 # set up shared environment variables
    87 !include ..\..\make\helpers.in
    88 # define $(OBJ), which contains all object targets
     17# ***************************************************************************
     18# *
     19# *     1) include generic setup definitions (compiler options etc.)
     20# *
     21# ***************************************************************************
     22
     23!include $(PROJECT_BASE_DIR)\config.in
     24!include $(PROJECT_BASE_DIR)\make\setup.in
     25
     26# ***************************************************************************
     27# *
     28# *     2) include mode-specific compiler inference rules
     29# *
     30# ***************************************************************************
     31
     32!ifndef CC_HELPERS
     33CC_HELPERS = error!
     34!endif
     35
     36!ifndef NOINCLUDEDEPEND
     37!ifndef OUTPUTDIR_HELPERS
     38!error OUTPUTDIR_HELPERS is not defined.
     39!endif
     40!endif
     41
     42CC = $(CC_HELPERS)
     43OUTPUTDIR = $(OUTPUTDIR_HELPERS)
     44
     45!include $(MAKE_INCLUDE_DIR)\_sub_compile.in
     46
     47# ***************************************************************************
     48# *
     49# *     3) list objects to be built
     50# *
     51# ***************************************************************************
     52
    8953!include helpers_pre.in
    9054
    91 plainc:   \
    92 !ifndef MAINMAKERUNNING
    93     callmainmake
    94     @echo ----- Leaving $(MAKEDIR)
    95 !else
    96     $(OUTPUTDIR)\plainc.lib
    97 #$(OBJS)
    98     @echo ----- Leaving $(MAKEDIR)
    99 !endif
     55# ***************************************************************************
     56# *
     57# *     4) define specific stuff for linker include
     58# *
     59# ***************************************************************************
    10060
    101 cp:   \
    102 !ifndef MAINMAKERUNNING
    103     callmainmake
    104     @echo ----- Leaving $(MAKEDIR)
    105 !else
    106     $(OUTPUTDIR)\cp.lib
    107 #$(OBJS)
    108     @echo ----- Leaving $(MAKEDIR)
    109 !endif
     61# ***************************************************************************
     62# *
     63# *     5) link executable
     64# *
     65# ***************************************************************************
    11066
    111 # Define the main dependency between the output HELPERS.LIB and
    112 # all the object files.
    113 # $? represents the names of all dependent files that are
    114 # out-of-date with respect to the target file.
    115 # The exclamation point ( ! ) preceding the LIB command causes NMAKE
    116 # to execute the LIB command once for each dependent file in the list.
     67ALLTARGET = $(OUTPUTDIR)\helpers.lib
    11768
    118 $(OUTPUTDIR)\helpers.lib: $(OBJS) makefile
    119 !ifdef EMX
    120     !emxomfar cr $* $?
    121 !else
     69# ***************************************************************************
     70# *
     71# *     6) define main target
     72# *
     73# ***************************************************************************
     74
     75!include $(MAKE_INCLUDE_DIR)\targets.in
     76
     77$(OUTPUTDIR)\helpers.lib: $(OBJS)
    12278    - del $@
    12379    ilib /nol /nob $@ @<<$(TEMP)\ilib.lnk
     
    12581);
    12682<<KEEP
    127 !endif
    12883
    129 # same thing for cp.lib
    130 $(OUTPUTDIR)\cp.lib: $(CPOBJS) makefile
    131 !ifdef EMX
    132     !emxomfar cr $* $?
    133 !else
     84# ***************************************************************************
     85# *
     86# *     explicit targets
     87# *
     88# ***************************************************************************
     89
     90cp: $(OUTPUTDIR)\helpers_cp.lib
     91
     92$(OUTPUTDIR)\helpers_cp.lib: $(CPOBJS)
    13493    - del $@
    135     ilib /nol /nob $@ @<<
     94    ilib /nol /nob $@ @<<$(TEMP)\ilib.lnk
    13695+$(CPOBJS: =&^
    13796);
    13897<<KEEP
    139 !endif
    140 
    141 # same thing for plainc.lib
    142 $(OUTPUTDIR)\plainc.lib: $(PLAINCOBJS) makefile
    143 !ifdef EMX
    144     !emxomfar cr $* $?
    145 !else
    146     - del $@
    147     ilib /nol /nob $@ @<<
    148 +$(PLAINCOBJS: =&^
    149 );
    150 <<KEEP
    151 !endif
    152 
    153 !include helpers_post.in
    154 
    155 ALLTARGET = $(OUTPUTDIR)\helpers.lib
    156 
    157 !include ..\..\make\targets.in
    158 
    159 ###################################################
    160 #
    161 # "test" target: for test cases
    162 #
    163 ###################################################
    164 
    165 TESTCASE_DIR = testcase
    166 
    167 !undef DEBUGDIALOG
    168 !ifdef DBGDLG
    169 DEBUGDIALOG = /DDEBUG_DIALOG_WINDOWS=1
    170 !endif
    171 
    172 TESTCASE_CC_BASE = icc /c /ti+ /w2 /ss /se /D__DEBUG__=1 $(DEBUGDIALOG) /i..\..\include
    173 
    174 TESTCASE_CC = $(TESTCASE_CC_BASE) /Fo$(TESTCASE_DIR)\$(@B).obj  $(@B).c
    175 
    176 .c.{$(TESTCASE_DIR)}.obj:
    177     @echo $(MAKEDIR)\makefile: Compiling $(@B).c
    178     @echo INCLUDE is $(INCLUDE)
    179     $(TESTCASE_CC)
    180 
    181 # testcase executables
    182 TESTCASE_TARGETS = \
    183     dosh.exe \
    184     dialog.exe \
    185     exeh.exe \
    186     fdlg.exe \
    187     fdlg_pm.exe \
    188     xmap.exe \
    189     vcard.exe
    190 
    191 # dialog.exe
    192 DIALOG_TEST_OBJS = \
    193     $(TESTCASE_DIR)\dialog.obj \
    194     $(TESTCASE_DIR)\_test_dialog.obj \
    195     $(TESTCASE_DIR)\winh.obj \
    196     $(TESTCASE_DIR)\xstring.obj \
    197     $(TESTCASE_DIR)\linklist.obj \
    198     $(TESTCASE_DIR)\cctl_checkcnr.obj \
    199     $(TESTCASE_DIR)\cnrh.obj \
    200     $(TESTCASE_DIR)\comctl.obj \
    201     $(TESTCASE_DIR)\stringh.obj \
    202     $(TESTCASE_DIR)\dosh.obj \
    203     $(TESTCASE_DIR)\except.obj \
    204     $(TESTCASE_DIR)\debug.obj \
    205     $(TESTCASE_DIR)\textview.obj \
    206     $(TESTCASE_DIR)\textv_html.obj \
    207     $(TESTCASE_DIR)\tmsgfile.obj \
    208     $(TESTCASE_DIR)\datetime.obj \
    209     $(TESTCASE_DIR)\tree.obj \
    210     $(TESTCASE_DIR)\gpih.obj \
    211     $(TESTCASE_DIR)\prfh.obj \
    212     $(TESTCASE_DIR)\nls.obj \
    213     $(TESTCASE_DIR)\nlscache.obj
    214 
    215 $(TESTCASE_DIR)\dialog.obj: ..\..\include\helpers\dialog.h
    216 $(TESTCASE_DIR)\_test_dialog.obj: ..\..\include\helpers\dialog.h
    217 
    218 dialog.exe: $(DIALOG_TEST_OBJS)
    219     ilink /debug /optfunc /pmtype:pm $(DIALOG_TEST_OBJS) pmprintf.lib /o:$@
    220 
    221 # dosh.exe
    222 DOSH_TEST_OBJS = \
    223     $(TESTCASE_DIR)\dosh.obj \
    224     $(TESTCASE_DIR)\_test_dosh.obj
    225 
    226 dosh.exe: $(DOSH_TEST_OBJS)
    227     ilink /debug /optfunc /pmtype:vio $(DOSH_TEST_OBJS) pmprintf.lib /o:$@
    228 
    229 # exeh.exe
    230 EXEH_TEST_OBJS = \
    231     $(TESTCASE_DIR)\dosh.obj \
    232     $(TESTCASE_DIR)\exeh.obj \
    233     $(TESTCASE_DIR)\stringh.obj \
    234     $(TESTCASE_DIR)\xstring.obj \
    235     $(TESTCASE_DIR)\_test_exeh.obj
    236 
    237 exeh.exe: $(EXEH_TEST_OBJS)
    238     ilink /debug /optfunc /pmtype:vio $(EXEH_TEST_OBJS) pmprintf.lib /o:$@
    239 
    240 # fdlg.exe
    241 FDLG_TEST_OBJS_SHARED = \
    242     $(TESTCASE_DIR)\comctl.obj \
    243     $(TESTCASE_DIR)\cctl_cnr.obj \
    244     $(TESTCASE_DIR)\cctl_cnr_dtls.obj \
    245     $(TESTCASE_DIR)\cctl_toolbar.obj \
    246     $(TESTCASE_DIR)\cctl_tooltip.obj \
    247     $(TESTCASE_DIR)\cctl_xframe.obj \
    248     $(TESTCASE_DIR)\cnrh.obj \
    249     $(TESTCASE_DIR)\dosh.obj \
    250     $(TESTCASE_DIR)\gpih.obj \
    251     $(TESTCASE_DIR)\linklist.obj \
    252     $(TESTCASE_DIR)\winh.obj \
    253     $(TESTCASE_DIR)\stringh.obj \
    254     $(TESTCASE_DIR)\xstring.obj \
    255     $(TESTCASE_DIR)\prfh.obj \
    256     $(TESTCASE_DIR)\tree.obj \
    257     $(TESTCASE_DIR)\nls.obj \
    258     $(TESTCASE_DIR)\nlscache.obj
    259 
    260 FDLG_TEST_OBJS = \
    261     $(FDLG_TEST_OBJS_SHARED) \
    262     $(TESTCASE_DIR)\_call_filedlg.obj
    263 
    264 $(TESTCASE_DIR)\_call_filedlg_pm.obj: _call_filedlg.c
    265     @echo $(MAKEDIR)\makefile: Compiling $(@B).c (PM version)
    266     @echo INCLUDE is $(INCLUDE)
    267     $(TESTCASE_CC_BASE) /D__USE_PM_CNR__=1 /Fo$(TESTCASE_DIR)\_call_filedlg_pm.obj _call_filedlg.c
    268 
    269 FDLG_TEST_OBJS_PM = \
    270     $(FDLG_TEST_OBJS_SHARED) \
    271     $(TESTCASE_DIR)\_call_filedlg_pm.obj
    272 
    273 fdlg.exe: $(FDLG_TEST_OBJS) makefile
    274     @echo $(MAKEDIR)\makefile: Linking $@
    275     ilink /nologo /debug /pmtype:pm $(FDLG_TEST_OBJS) pmprintf.lib /o:$@
    276 
    277 fdlg_pm.exe: $(FDLG_TEST_OBJS_PM) makefile
    278     @echo $(MAKEDIR)\makefile: Linking $@ (PM version)
    279     ilink /nologo /debug /pmtype:pm $(FDLG_TEST_OBJS_PM) pmprintf.lib /o:$@
    280 
    281 # xmap.exe
    282 MAP_TEST_OBJS = \
    283     $(TESTCASE_DIR)\map_vac.obj \
    284     $(TESTCASE_DIR)\linklist.obj \
    285     $(TESTCASE_DIR)\stringh.obj \
    286     $(TESTCASE_DIR)\xstring.obj \
    287     $(TESTCASE_DIR)\_test_map.obj
    288 
    289 xmap.exe: $(MAP_TEST_OBJS)
    290     ilink /debug /optfunc /pmtype:vio $(MAP_TEST_OBJS) pmprintf.lib /o:$@
    291 
    292 # vcard.exe
    293 VCARD_TEST_OBJS = \
    294     $(TESTCASE_DIR)\vcard.obj \
    295     $(TESTCASE_DIR)\_test_vcard.obj \
    296     $(TESTCASE_DIR)\xstring.obj \
    297     $(TESTCASE_DIR)\stringh.obj \
    298     $(TESTCASE_DIR)\linklist.obj \
    299     $(TESTCASE_DIR)\dosh.obj \
    300     $(TESTCASE_DIR)\prfh.obj \
    301     $(TESTCASE_DIR)\nls.obj \
    302     $(TESTCASE_DIR)\except.obj \
    303     $(TESTCASE_DIR)\debug.obj \
    304     $(TESTCASE_DIR)\tree.obj
    305 
    306 vcard.exe: $(VCARD_TEST_OBJS)
    307     ilink /debug /pmtype:vio $(VCARD_TEST_OBJS) /o:$@
    308 
    309 test: $(TESTCASE_TARGETS)
    31098
    31199
Note: See TracChangeset for help on using the changeset viewer.