about summary refs log blame commit diff stats
path: root/config.mk
blob: b18ad3308073ab8a823834392a8033fbe7cfc91b (plain) (tree)
pre { line-height: 125%; } td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.D
# dwm version
VERSION = 5.0

# Customize below to fit your system

# paths
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man

X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib

# includes and libs
INCS = -I. -I/usr/include -I${X11INC}
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11

# flags
CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\"
LDFLAGS = -s ${LIBS}
#CFLAGS = -g -std=c99 -pedantic -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = -g ${LIBS}

# Solaris
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
#LDFLAGS = ${LIBS}

# compiler and linker
CC = cc
pan><< "'and' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); break; } break; } :(before "End Primitive Recipe Implementations") case AND: { bool result = true; for (int i = 0; i < SIZE(ingredients); ++i) result = result && scalar_ingredient(ingredients, i); products.resize(1); products.at(0).push_back(result); break; } :(code) double scalar_ingredient(const vector<vector<double> >& ingredients, int i) { if (is_mu_address(current_instruction().ingredients.at(i))) return ingredients.at(i).at(/*skip alloc id*/1); return ingredients.at(i).at(0); } void test_and() { run( "def main [\n" " 1:bool <- copy true\n" " 2:bool <- copy false\n" " 3:bool <- and 1:bool, 2:bool\n" "]\n" ); CHECK_TRACE_CONTENTS( "mem: storing 0 in location 3\n" ); } void test_and_2() { run( "def main [\n" " 1:bool <- and true, true\n" "]\n" ); CHECK_TRACE_CONTENTS( "mem: storing 1 in location 1\n" ); } void test_and_multiple() { run( "def main [\n" " 1:bool <- and true, true, false\n" "]\n" ); CHECK_TRACE_CONTENTS( "mem: storing 0 in location 1\n" ); } void test_and_multiple_2() { run( "def main [\n" " 1:bool <- and true, true, true\n" "]\n" ); CHECK_TRACE_CONTENTS( "mem: storing 1 in location 1\n" ); } :(before "End Primitive Recipe Declarations") OR, :(before "End Primitive Recipe Numbers") put(Recipe_ordinal, "or", OR); :(before "End Primitive Recipe Checks") case OR: { for (int i = 0; i < SIZE(inst.ingredients); ++i) { if (!is_mu_scalar(inst.ingredients.at(i))) { raise << maybe(get(Recipe, r).name) << "'and' requires boolean ingredients, but got '" << inst.ingredients.at(i).original_string << "'\n" << end(); goto finish_checking_instruction; } } if (SIZE(inst.products) > 1) { raise << maybe(get(Recipe, r).name) << "'or' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); break; } if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) { raise << maybe(get(Recipe, r).name) << "'or' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); break; } break; } :(before "End Primitive Recipe Implementations") case OR: { bool result = false; for (int i = 0; i < SIZE(ingredients); ++i) result = result || scalar_ingredient(ingredients, i); products.resize(1); products.at(0).push_back(result); break; } :(code) void test_or() { run( "def main [\n" " 1:bool <- copy true\n" " 2:bool <- copy false\n" " 3:bool <- or 1:bool, 2:bool\n" "]\n" ); CHECK_TRACE_CONTENTS( "mem: storing 1 in location 3\n" ); } void test_or_2() { run( "def main [\n" " 1:bool <- or false, false\n" "]\n" ); CHECK_TRACE_CONTENTS( "mem: storing 0 in location 1\n" ); } void test_or_multiple() { run( "def main [\n" " 1:bool <- or false, false, false\n" "]\n" ); CHECK_TRACE_CONTENTS( "mem: storing 0 in location 1\n" ); } void test_or_multiple_2() { run( "def main [\n" " 1:bool <- or false, false, true\n" "]\n" ); CHECK_TRACE_CONTENTS( "mem: storing 1 in location 1\n" ); } :(before "End Primitive Recipe Declarations") NOT, :(before "End Primitive Recipe Numbers") put(Recipe_ordinal, "not", NOT); :(before "End Primitive Recipe Checks") case NOT: { if (SIZE(inst.products) != SIZE(inst.ingredients)) { raise << "ingredients and products should match in '" << to_original_string(inst) << "'\n" << end(); break; } for (int i = 0; i < SIZE(inst.ingredients); ++i) { if (!is_mu_scalar(inst.ingredients.at(i)) && !is_mu_address(inst.ingredients.at(i))) { raise << maybe(get(Recipe, r).name) << "'not' requires ingredients that can be interpreted as boolean, but got '" << inst.ingredients.at(i).original_string << "'\n" << end(); goto finish_checking_instruction; } } for (int i = 0; i < SIZE(inst.products); ++i) { if (is_dummy(inst.products.at(i))) continue; if (!is_mu_boolean(inst.products.at(i))) { raise << maybe(get(Recipe, r).name) << "'not' should yield a boolean, but got '" << inst.products.at(i).original_string << "'\n" << end(); goto finish_checking_instruction; } } break; } :(before "End Primitive Recipe Implementations") case NOT: { products.resize(SIZE(ingredients)); for (int i = 0; i < SIZE(ingredients); ++i) { products.at(i).push_back(!scalar_ingredient(ingredients, i)); } break; } :(code) void test_not() { run( "def main [\n" " 1:bool <- copy true\n" " 2:bool <- not 1:bool\n" "]\n" ); CHECK_TRACE_CONTENTS( "mem: storing 0 in location 2\n" ); } void test_not_multiple() { run( "def main [\n" " 1:bool, 2:bool, 3:bool <- not true, false, true\n" "]\n" ); CHECK_TRACE_CONTENTS( "mem: storing 0 in location 1\n" "mem: storing 1 in location 2\n" "mem: storing 0 in location 3\n" ); }