VirtualBox

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


Ignore:
Timestamp:
Jan 8, 2009 1:19:16 AM (16 years ago)
Author:
bird
Message:

kBuild: Implemented flex and yacc/bison support. Fixes #18.

File:
1 edited

Legend:

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

    r2019 r2224  
    55
    66#
    7 # Copyright (c) 2005-2008 knut st. osmundsen <[email protected]>
     7# Copyright (c) 2005-2009 knut st. osmundsen <[email protected]>
    88#
    99# This file is part of kBuild.
     
    7777        bltin/kill.c \
    7878        bltin/test.c \
    79         $(PATH_kmk_ash)/arith.c \
    8079        $(PATH_kmk_ash)/builtins.c \
    8180        $(PATH_kmk_ash)/init.c \
     
    9897
    9998kmk_ash_INTERMEDIATES = \
    100         $(PATH_kmk_ash)/arith.h \
    10199        $(PATH_kmk_ash)/builtins.h \
    102100        $(PATH_kmk_ash)/nodes.h \
     
    104102kmk_ash_CLEAN = \
    105103        $(kmk_ash_INTERMEDIATES) \
    106         $(PATH_kmk_ash)/arith.c \
    107         $(PATH_kmk_ash)/arith_lex.c \
    108104        $(PATH_kmk_ash)/builtins.c \
    109105        $(PATH_kmk_ash)/init.c \
     
    140136#
    141137
    142 ifeq (1,2) #disabled for now.
    143 kmk_ash_USES = lex #yacc
    144 kmk_ash_SOURCES += arith_lex.l
     138USES += lex yacc
     139kmk_ash_USES = lex yacc
    145140kmk_ash_LEXTOOL = FLEX
    146141kmk_ash_LEXFLAGS = -8
    147 else
    148 kmk_ash_SOURCES += $(PATH_kmk_ash)/arith_lex.c
    149 endif
     142#kmk_ash_YACCTOOL = BISON
     143kmk_ash_YACCTOOL = YACC
     144kmk_ash_YACCFLAGS = -ld
     145kmk_ash_SOURCES += \
     146        arith.y \
     147        arith_lex.l
     148
    150149
    151150include $(FILE_KBUILD_SUB_FOOTER)
     
    160159#
    161160BOOTSTRAP_SHELL ?= $(SHELL)
    162 ifndef YACC
    163  YACC := $(firstword $(which byacc) $(which yacc) yacc)
    164 endif
    165 
    166 $(PATH_kmk_ash)/arith.h + $(PATH_kmk_ash)/arith.c: $(kmk_ash_PATH)/arith.y | $(call DIRDEP,$(PATH_kmk_ash))
    167         $(YACC) -ld $^
    168         $(MV) -f y.tab.c $(PATH_kmk_ash)/arith.c
    169         $(MV) -f y.tab.h $(PATH_kmk_ash)/arith.h
    170 
    171 ifndef kmk_ash_LEXTOOL
    172 $(PATH_kmk_ash)/arith_lex.c: $(kmk_ash_PATH)/arith_lex.l | $(call DIRDEP,$(PATH_kmk_ash))
    173         flex -8 -o$@ $^                     # 8-bit lex scanner for arithmetic
    174 endif
    175161
    176162$(PATH_kmk_ash)/builtins.h + $(PATH_kmk_ash)/builtins.c: \
     
    202188
    203189endif # generate on the fly
     190
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