00001
#############################################################################
00002
#
00003
# This is the first phase of building keyboard layouts
00004
#
00005
# For each *.txt layout definition (eg: kbdbe.txt kbdbtr.txt etc.):
00006
# - make the ..\tmp\* directory
00007
# - generate "sources", "makefile" and "makefile.inc" files in ..\tmp\*
00008
#
00009
# Also generate the ..\tmp\dirs files
00010
#
00011
# THIS FILE IS INCLUDED BY ..\us_kbd\makefile.inc
00012
#
00013
#############################################################################
00014
00015
#
00016
# Layout names (eg: kbdbe)
00017
#
00018
TARGETNAMES=$(SOURCES:.c=)
00019
00020
#
00021
# Directories in which layout will be built (eg: ..\tmp\kbdbe)
00022
#
00023
TARGETDIRS=$(TARGETNAMES:kbd=..\tmp\kbd)
00024
00025
#
00026
# "sources" files used by BUILD to compile layouts (eg: kbdbe\sources)
00027
#
00028
TARGETSOURCEFILES=$(SOURCES:.c=\sources)
00029
00030
#############################################################################
00031
#
00032
# Build all
00033
# builds the "dirs" file that steers the compile and link phase
00034
#
00035
#############################################################################
00036
all: always_build_dirs $(TARGETSOURCEFILES:kbd=..\tmp\kbd)
00037
00038
#
00039
# build -clean does this
00040
#
00041
clean:
00042 delnode /q ..\tmp\*
00043
00044
#
00045
# Build the DIRS file in ..\tmp
00046
# do this always
00047
#
00048
always_build_dirs: ..\tmp\dirs
00049 type << > ..\tmp\dirs
00050 DIRS=\
00051 $(TARGETNAMES)
00052 <<
00053
00054
00055
#
00056
# If the "sources" or (this) "makefile.inc" file in this directory have
00057
# changed, make the TARGETDIRS out of date (by deleting)
00058
#
00059
..\tmp\dirs: ..\all_kbds\sources ..\us_kbd\sources makefile.inc
00060 -md ..\tmp
00061 type << > ..\tmp\dirs
00062 DIRS=\
00063 $(TARGETNAMES)
00064 <<
00065 delnode /q ..\tmp\kbd*
00066
00067
#
00068
# Dependencies to make sure the "sources" files are built
00069
# (eg: ..\tmp\kbdbe\sources: ..\tmp\kbdbe)
00070
#
00071
$(TARGETSOURCEFILES:kbd=..\tmp\kbd): $$(@
D)
00072
00073
00074
#
00075
# build the SOURCES, MAKEFILE and MAKEFILE.INC in each ..\tmp\kbd*
00076
# The target of this rule is a directory, which is a problem, since the
00077
# timestamp of these can only change if the directory is deleted and
00078
# recreated: hence the delnode /q ..\tmp\kbd* line is the ..\tmp\dirs
00079
# rule (above). This deletes the _objects.mac files so you have to run
00080
# build twice is either the sources or makefile.inc files are updated.
00081
# To get around this by changing the
00082
#
00083
$(TARGETDIRS): sources ..\all_kbds\makefile.inc
00084 -md $@
00085 copy ..\all_kbds\makefile.tpl $@\makefile
00086 type << > $@\makefile.inc
00087 $(@B).c $(@B).h $(@B).rc $(@B).def: ..\..\all_kbds\$(@B).txt
00088 kbdtool ..\..\all_kbds\$(@B).txt
00089 <<
00090 type << > $@\sources._xx
00091 ^!
IF 0
00092
Copyright (c) 1995 Microsoft Corporation
00093 ^!ENDIF
00094
00095 NOLINK=
00096 MAJORCOMP=user
00097 MINORCOMP=$(@B)
00098 TARGETNAME=$(@B)
00099 TARGETPATH=obj
00100 TARGETTYPE=DYNLINK
00101 TARGETLIBS=
00102 INCLUDES=..\..\..\inc
00103 SOURCES=$(@B).c $(@B).rc
00104 C_DEFINES=
00105 UMTYPE=nt
00106 UMTEST=
00107 UMAPPL=
00108 UMBASE=0x1000000
00109 UMLIBS=
00110 ^!
if $$(IA64)
00111 SECTION_ALIGNMENT=0x4000
00112 LINKER_FLAGS = -merge:.edata=.data -merge:.srdata=.data -merge:.text=.data -merge:.bss=.data -section:.data,re
00113 ^!
else
00114 LINKER_FLAGS = -merge:.edata=.data -merge:.rdata=.data -merge:.text=.data -merge:.bss=.data -section:.data,re
00115 ^!endif
00116
00117 NTTARGETFILE0=$(@B).h $(@B).rc $(@B).def
00118 <<
00119 sed
"s/^\^//" $@\sources._xx > $@\sources
00120 del /f $@\sources._xx