VirtualBox

Changeset 1784 in kBuild for trunk/src/kash/Makefile.kmk


Ignore:
Timestamp:
Sep 13, 2008 3:27:59 AM (16 years ago)
Author:
bird
Message:

kash: hacking.

File:
1 edited

Legend:

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

    r1665 r1784  
    3838kash_DEFS.linux = BSD
    3939kash_DEFS.solaris = BSD
     40## @todo bring over PC_SLASHES?
    4041kash_DEFS.win = \
    4142        BSD PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS YY_NO_UNISTD_H
     
    5051        HAVE_SYS_SIGNAME HAVE_SYSCTL_H HAVE_SETPROGNAME
    5152kash_INCS = $(PATH_kash) . # (the last is because of error.h)
     53if "$(USER)" == "bird" && "$(KBUILD_TARGET)" != "win"
     54kash_CFLAGS += -std=gnu99
     55endif
    5256kash_SOURCES = \
    5357        main.c \
     
    97101        strlcpy.c
    98102
    99 kash_ORDERDEPS = \
     103kash_INTERMEDIATES = \
    100104        $(PATH_kash)/arith.h \
    101105        $(PATH_kash)/builtins.h \
     
    103107        $(PATH_kash)/token.h
    104108kash_CLEAN = \
    105         $(kash_ORDERDEPS)       \
     109        $(kash_INTERMEDIATES) \
    106110        $(PATH_kash)/arith.c \
    107111        $(PATH_kash)/arith_lex.c \
     
    118122
    119123
    120 ifeq ($(filter-out win,$(KBUILD_TARGET)),)
     124if1of ($(KBUILD_TARGET), win)
    121125
    122126#
     
    127131kash_SOURCES := $(patsubst $(PATH_kash)/%,generated/%,$(kash_SOURCES))
    128132
    129 include $(FILE_KBUILD_SUB_FOOTER)
    130 
    131133else
    132 
    133 include $(FILE_KBUILD_SUB_FOOTER)
    134134
    135135#
     
    142142#
    143143BOOTSTRAP_SHELL ?= $(SHELL)
    144 YACC ?= yacc
     144ifndef YACC
     145 YACC := $(firstword $(which byacc) $(which yacc) yacc)
     146endif
    145147
    146 $(PATH_kash)/arith.h $(PATH_kash)/arith.c: arith.y | $(call DIRDEP,$(PATH_kash))
     148$$(PATH_kash)/arith.h + $$(PATH_kash)/arith.c: arith.y | $$(dir $$@)
    147149        $(YACC) -ld $^
    148150        $(MV) -f y.tab.c $(PATH_kash)/arith.c
    149151        $(MV) -f y.tab.h $(PATH_kash)/arith.h
    150152
    151 $(PATH_kash)/arith_lex.c: arith_lex.l | $(call DIRDEP,$(PATH_kash))
     153$$(PATH_kash)/arith_lex.c: $$(kash_DEFPATH)/arith_lex.l | $$(dir $$@)
    152154        flex -8 -o$@ $^                     # 8-bit lex scanner for arithmetic
    153155
    154 $(PATH_kash)/builtins.h $(PATH_kash)/builtins.c: $(kash_PATH)/mkbuiltins shell.h builtins.def | $(call DIRDEP,$(PATH_kash))
     156$$(PATH_kash)/builtins.h + $$(PATH_kash)/builtins.c: \
     157                $$(kash_DEFPATH)/mkbuiltins \
     158                $$(kash_DEFPATH)/shell.h \
     159                $$(kash_DEFPATH)/builtins.def \
     160                | $$(dir $$@)
    155161        $(BOOTSTRAP_SHELL) $+ $(dir $@)
    156162        [ -f $(PATH_kash)/builtins.h ]
    157163
    158 $(PATH_kash)/nodes.h $(PATH_kash)/nodes.c: $(kash_PATH)/mknodes.sh nodetypes nodes.c.pat | $(call DIRDEP,$(PATH_kash))
     164$$(PATH_kash)/nodes.h + $$(PATH_kash)/nodes.c: \
     165        $$(kash_DEFPATH)/mknodes.sh \
     166        $$(kash_DEFPATH)/nodetypes \
     167        $$(kash_DEFPATH)/nodes.c.pat \
     168        | $$(dir $$@)
    159169        $(BOOTSTRAP_SHELL) $+ $(dir $@)
    160170        [ -f $(dir $@)/nodes.h ]
    161171
    162 $(PATH_kash)/token.h: $(kash_PATH)/mktokens | $(call DIRDEP,$(PATH_kash))
     172$$(PATH_kash)/token.h: $$(kash_DEFPATH)/mktokens | $$(dir $$@)
    163173        $(BOOTSTRAP_SHELL) $+
    164174        $(MV) token.h $@
    165175
    166 $(PATH_kash)/init.c: $(kash_PATH)/mkinit.sh $(filter-out $(PATH_kash)/%,$(kash_SOURCES)) | $(call DIRDEP,$(PATH_kash))
     176$$(PATH_kash)/init.c: \
     177                $$(kash_DEFPATH)/mkinit.sh \
     178                $$(abspathex $$(filter-out $$(PATH_kash)/%,$$(kash_SOURCES)), $$(kash_DEFPATH)) \
     179                | $$(dir $$@)
    167180        $(BOOTSTRAP_SHELL) $+
    168181        $(MV) init.c $@
    169182
    170183endif
     184
     185include $(FILE_KBUILD_SUB_FOOTER)
     186
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