#!/usr/bin/env python
#
-# Copyright (c) 2001, 2002 Steven Knight
+# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
test.write('SConstruct', """
env = Environment()
f1 = env.Object(target = 'f1', source = 'f1.c')
-f2 = env.Object(target = 'f2', source = 'f2.cpp')
+f2 = Object(target = 'f2', source = 'f2.cpp')
f3 = env.Object(target = 'f3', source = 'f3.c')
-env.Program(target = 'prog1', source = Split('f1%s f2%s f3%s prog.cpp'))
-env.Program(target = 'prog2', source = [f1, f2, f3, 'prog.cpp'])
+mult_o = env.Object(['f4.c', 'f5.c'])
+env.Program(target = 'prog1', source = Split('f1%s f2%s f3%s f4%s prog.cpp'))
+env.Program(target = 'prog2', source = mult_o + [f1, f2, f3, 'prog.cpp'])
env.Program(target = 'prog3', source = ['f1%s', f2, 'f3%s', 'prog.cpp'])
-""" % (_obj, _obj, _obj, _obj, _obj))
+""" % (_obj, _obj, _obj, _obj, _obj, _obj))
test.write('f1.c', r"""
+#include <stdio.h>
void
f1(void)
{
- printf("f1.c\n");
+ printf("f1.c\n");
}
""")
void
f2(void)
{
- printf("f2.c\n");
+ printf("f2.c\n");
}
""")
test.write('f3.c', r"""
+#include <stdio.h>
void
f3(void)
{
- printf("f3.c\n");
+ printf("f3.c\n");
+}
+""")
+
+test.write('f4.c', r"""
+#include <stdio.h>
+void
+f4(void)
+{
+ printf("f4.c\n");
+}
+""")
+
+test.write('f5.c', r"""
+#include <stdio.h>
+void
+f5(void)
+{
+ printf("f5.c\n");
}
""")
int
main(int argc, char *argv[])
{
- argv[argc++] = "--";
- f1();
- f2();
- f3();
- printf("prog.c\n");
- return 0;
+ argv[argc++] = (char *)"--";
+ f1();
+ f2();
+ f3();
+ printf("prog.c\n");
+ return 0;
}
""")
test.run(program = test.workpath('prog3'), stdout = stdout)
test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: