VirtualBox

Changeset 1665 in kBuild for trunk/src/ash/Makefile.kmk


Ignore:
Timestamp:
Jun 30, 2008 9:14:11 PM (17 years ago)
Author:
bird
Message:

Converted to a sub-makefile setup ('single' makefile).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ash/Makefile.kmk

    r1624 r1665  
    11# $Id: Makefile.kmk 785 2007-01-24 22:21:56Z bird $
    22## @file
    3 # ash
     3# Sub-makefile for kmk_ash.
    44#
    55
     
    2525#
    2626
    27 DEPTH = ../..
    28 include $(PATH_KBUILD)/header.kmk
     27SUB_DEPTH = ../..
     28include $(KBUILD_PATH)/subheader.kmk
    2929
    3030#INSTALLS = ash.man
     
    4646kmk_ash_DEFS.freebsd = \
    4747        HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
    48 kmk_ash_INCS = $(PATH_TARGET) . # (the last is because of error.h)
    49 kmk_ash_CFLAGS.win = -I. ## @todo kBuild bug.
     48kmk_ash_INCS = $(PATH_kmk_ash) . # (the last is because of error.h)
     49kmk_ash_CFLAGS.win = -I. ## @todo kBuild bug?
    5050kmk_ash_INCS.win = win
    5151kmk_ash_SOURCES = \
     
    7575        bltin/kill.c \
    7676        bltin/test.c \
    77         $(PATH_TARGET)/arith.c \
    78         $(PATH_TARGET)/builtins.c \
    79         $(PATH_TARGET)/init.c \
    80         $(PATH_TARGET)/nodes.c
     77        $(PATH_kmk_ash)/arith.c \
     78        $(PATH_kmk_ash)/builtins.c \
     79        $(PATH_kmk_ash)/init.c \
     80        $(PATH_kmk_ash)/nodes.c
    8181kmk_ash_SOURCES.linux = \
    8282        sys_signame.c \
     
    9696
    9797kmk_ash_INTERMEDIATES = \
    98         $(PATH_TARGET)/arith.h \
    99         $(PATH_TARGET)/builtins.h \
    100         $(PATH_TARGET)/nodes.h \
    101         $(PATH_TARGET)/token.h
     98        $(PATH_kmk_ash)/arith.h \
     99        $(PATH_kmk_ash)/builtins.h \
     100        $(PATH_kmk_ash)/nodes.h \
     101        $(PATH_kmk_ash)/token.h
    102102kmk_ash_CLEAN = \
    103103        $(kmk_ash_INTERMEDIATES) \
    104         $(PATH_TARGET)/arith.c \
    105         $(PATH_TARGET)/arith_lex.c \
    106         $(PATH_TARGET)/builtins.c \
    107         $(PATH_TARGET)/init.c \
    108         $(PATH_TARGET)/nodes.c
     104        $(PATH_kmk_ash)/arith.c \
     105        $(PATH_kmk_ash)/arith_lex.c \
     106        $(PATH_kmk_ash)/builtins.c \
     107        $(PATH_kmk_ash)/init.c \
     108        $(PATH_kmk_ash)/nodes.c
    109109
    110110kmk_ash.man_TEMPLATE = usr.bin.man
     
    115115
    116116if1of ($(KBUILD_TARGET), win nt)
    117 
    118117#
    119118# Use the pregenerated code.
    120119#
    121120kmk_ash_DEPS :=
    122 kmk_ash_SOURCES += $(PATH_TARGET)/arith_lex.c
     121kmk_ash_SOURCES += $(PATH_kmk_ash)/arith_lex.c
     122
     123include $(FILE_KBUILD_SUB_FOOTER)
    123124
    124125define def_copy_generated
    125 $(PATH_TARGET)/$(src): generated/$(src)
     126$(PATH_kmk_ash)/$(src): generated/$(src)
    126127        $$(RM) -f $$@
    127128        $$(CP) -f $$^ $$@
    128 kmk_ash_DEPS += $(PATH_TARGET)/$(src)
    129129endef
    130130
     
    132132$(eval $(def_copy_generated)))
    133133
    134 include $(FILE_KBUILD_FOOTER)
    135134
    136135else
     136#
     137# Generate the code on the fly.
     138#
    137139
    138140ifeq (1,2) #disabled for now.
     
    142144kmk_ash_LEXFLAGS = -8
    143145else
    144 kmk_ash_SOURCES += $(PATH_TARGET)/arith_lex.c
     146kmk_ash_SOURCES += $(PATH_kmk_ash)/arith_lex.c
    145147endif
    146148
    147 include $(FILE_KBUILD_FOOTER)
     149include $(FILE_KBUILD_SUB_FOOTER)
    148150
    149151#
     
    160162endif
    161163
    162 $(PATH_TARGET)/arith.h + $(PATH_TARGET)/arith.c: arith.y | $(call DIRDEP,$(PATH_TARGET))
     164$(PATH_kmk_ash)/arith.h + $(PATH_kmk_ash)/arith.c: $(kmk_ash_PATH)/arith.y | $(call DIRDEP,$(PATH_kmk_ash))
    163165        $(YACC) -ld $^
    164         $(MV) -f y.tab.c $(PATH_TARGET)/arith.c
    165         $(MV) -f y.tab.h $(PATH_TARGET)/arith.h
     166        $(MV) -f y.tab.c $(PATH_kmk_ash)/arith.c
     167        $(MV) -f y.tab.h $(PATH_kmk_ash)/arith.h
    166168
    167169ifndef kmk_ash_LEXTOOL
    168 $(PATH_TARGET)/arith_lex.c: arith_lex.l | $(call DIRDEP,$(PATH_TARGET))
     170$(PATH_kmk_ash)/arith_lex.c: $(kmk_ash_PATH)/arith_lex.l | $(call DIRDEP,$(PATH_kmk_ash))
    169171        flex -8 -o$@ $^                     # 8-bit lex scanner for arithmetic
    170172endif
    171173
    172 $(PATH_TARGET)/builtins.h + $(PATH_TARGET)/builtins.c: $(PATH_CURRENT)/mkbuiltins shell.h builtins.def | $(call DIRDEP,$(PATH_TARGET))
     174$(PATH_kmk_ash)/builtins.h + $(PATH_kmk_ash)/builtins.c: \
     175                $(kmk_ash_PATH)/mkbuiltins \
     176                $(kmk_ash_PATH)/shell.h \
     177                $(kmk_ash_PATH)/builtins.def \
     178                | $(call DIRDEP,$(PATH_kmk_ash))
    173179        $(BOOTSTRAP_SHELL) $+ $(dir $@)
    174         [ -f $(PATH_TARGET)/builtins.h ]
    175 
    176 $(PATH_TARGET)/nodes.h + $(PATH_TARGET)/nodes.c: $(PATH_CURRENT)/mknodes.sh nodetypes nodes.c.pat | $(call DIRDEP,$(PATH_TARGET))
     180        [ -f $(PATH_kmk_ash)/builtins.h ]
     181
     182$(PATH_kmk_ash)/nodes.h + $(PATH_kmk_ash)/nodes.c: \
     183                $(kmk_ash_PATH)/mknodes.sh \
     184                $(kmk_ash_PATH)/nodetypes \
     185                $(kmk_ash_PATH)/nodes.c.pat \
     186                | $(call DIRDEP,$(PATH_kmk_ash))
    177187        $(BOOTSTRAP_SHELL) $+ $(dir $@)
    178188        [ -f $(dir $@)/nodes.h ]
    179189
    180 $(PATH_TARGET)/token.h: $(PATH_CURRENT)/mktokens | $(call DIRDEP,$(PATH_TARGET))
     190$(PATH_kmk_ash)/token.h: $(kmk_ash_PATH)/mktokens | $(call DIRDEP,$(PATH_kmk_ash))
    181191        $(BOOTSTRAP_SHELL) $+
    182192        $(MV) token.h $@
    183193
    184 $(PATH_TARGET)/init.c: $(PATH_CURRENT)/mkinit.sh $(filter-out $(PATH_TARGET)/%,$(kmk_ash_SOURCES)) | $(call DIRDEP,$(PATH_TARGET))
     194$(PATH_kmk_ash)/init.c: \
     195                $(kmk_ash_PATH)/mkinit.sh \
     196                $(abspathex $(filter-out $(PATH_kmk_ash)/%,$(kmk_ash_SOURCES)), $(kmk_ash_PATH)) \
     197                | $(call DIRDEP,$(PATH_kmk_ash))
    185198        $(BOOTSTRAP_SHELL) $+
    186199        $(MV) init.c $@
    187200
    188 endif
     201endif # generate on the fly
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette