Skip to content

Commit e4e08ca

Browse files
committed
resurrected makefiles; tested it on tutorial; brushed the tutorial content
1 parent cb2f725 commit e4e08ca

34 files changed

Lines changed: 3032 additions & 34 deletions

L1_arrays_as_data/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# General Setup:
44
#
5-
SAC2CFLAGS = -check tb -v 1 -O3
5+
SAC2CFLAGS = -check ctb -v2 -O3
66

77
ifdef EXCLUDE_ERRORS
88
SAC2CFLAGS += -DEXCLUDE_ERRORS
@@ -17,7 +17,6 @@ endif
1717
# INCTARGETDIR = .
1818
# LIBSRCDIR = .
1919
# SUBDIRS =
20-
# MAKE_NON_LOCAL_DEPENDENCIES =
2120

2221
#
2322
# Setup for Makefile.versions
@@ -36,5 +35,4 @@ CHECKLOGFILE = ./CHECKLOG
3635
#
3736
#######################################################################################
3837

39-
include $(SACBASE)/stdlib/Makefiles/Makefile_template.prg
40-
38+
include $(SACBASE)/Makefiles/Makefile_template.prg

L2_shape-invariant_programming/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ endif
1111
#
1212
# Setup for Makefile.standard:
1313
#
14-
# EXCLUDE_FILES =
14+
EXCLUDE_FILES = relaxation.sac
1515
# TARGETDIR = .
1616
# LIBTARGETDIR = .
1717
# INCTARGETDIR = .
1818
# LIBSRCDIR = .
1919
# SUBDIRS =
20-
# MAKE_NON_LOCAL_DEPENDENCIES =
2120

2221
#
2322
# Setup for Makefile.versions
@@ -36,4 +35,4 @@ CHECKLOGFILE = ./CHECKLOG
3635
#
3736
#######################################################################################
3837

39-
include $(SACBASE)/stdlib/Makefiles/Makefile_template.prg
38+
include $(SACBASE)/Makefiles/Makefile_template.prg

L3_fun_types/E-17.sac

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use ScalarArith: all;
2+
3+
int, int divmod( int x, int y)
4+
{
5+
return( x/y, x%y);
6+
}
7+
8+
int main()
9+
{
10+
d, m = divmod( 8, 3);
11+
12+
return( d);
13+
}
14+

L3_fun_types/Makefile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#######################################################################################
2+
#
3+
# General Setup:
4+
#
5+
SAC2CFLAGS = -check ctb -v2 -O3
6+
7+
ifdef EXCLUDE_ERRORS
8+
SAC2CFLAGS += -DEXCLUDE_ERRORS
9+
endif
10+
11+
#
12+
# Setup for Makefile.standard:
13+
#
14+
# EXCLUDE_FILES =
15+
# TARGETDIR = .
16+
# LIBTARGETDIR = .
17+
# INCTARGETDIR = .
18+
# LIBSRCDIR = .
19+
# SUBDIRS =
20+
21+
#
22+
# Setup for Makefile.versions
23+
#
24+
# EXCLUDE_FILES_FOR_MT =
25+
# MAKE_MT_ALSO = yes
26+
# VERSDIR = .
27+
28+
#
29+
# Setup for Makefile.check:
30+
#
31+
CHECKLOGFILE = ./CHECKLOG
32+
# CHECKDIR = .checkdir
33+
# RT_FLAGS =
34+
# INPSDIR =
35+
#
36+
#######################################################################################
37+
38+
include $(SACBASE)/Makefiles/Makefile_template.prg

L4_fun_bodies/E-24.sac

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
use Array: all;
2+
use StdIO: all;
3+
4+
int, int[5] f()
5+
{ return ( 42, [21,21,21,21,21]);}
6+
7+
int main()
8+
{
9+
a = 42;
10+
print( a);
11+
a += 5;
12+
print( a);
13+
a -= a;
14+
print( a);
15+
16+
v = [1,2,3,4,5];
17+
print( v);
18+
v += 1;
19+
print( v);
20+
v[0] = 0;
21+
print( v);
22+
#if 0
23+
v[0] ++; //sp bug should be identical to: v = modarray( v, 0, ++ v[0]);
24+
#endif
25+
v = modarray( v, 0, ++ v[0]);
26+
print( v);
27+
28+
m=[v,v,v];
29+
print( m);
30+
#if 0
31+
m[0][0] = 42;
32+
#endif
33+
m[0] = modarray( m[0], 0, 42);
34+
print( m);
35+
m = modarray( m, 0, modarray( m[0], 0, 42));
36+
print( m);
37+
38+
#if 0
39+
v[1], m[1] +=f();
40+
#endif
41+
x,y = f();
42+
v[1] += x;
43+
m[1] += y;
44+
45+
print( v);
46+
print( m);
47+
48+
return( a);
49+
}
50+

L4_fun_bodies/Makefile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#######################################################################################
2+
#
3+
# General Setup:
4+
#
5+
SAC2CFLAGS = -check ctb -v2 -O3
6+
7+
ifdef EXCLUDE_ERRORS
8+
SAC2CFLAGS += -DEXCLUDE_ERRORS
9+
endif
10+
11+
#
12+
# Setup for Makefile.standard:
13+
#
14+
# EXCLUDE_FILES =
15+
# TARGETDIR = .
16+
# LIBTARGETDIR = .
17+
# INCTARGETDIR = .
18+
# LIBSRCDIR = .
19+
# SUBDIRS =
20+
21+
#
22+
# Setup for Makefile.versions
23+
#
24+
# EXCLUDE_FILES_FOR_MT =
25+
# MAKE_MT_ALSO = yes
26+
# VERSDIR = .
27+
28+
#
29+
# Setup for Makefile.check:
30+
#
31+
CHECKLOGFILE = ./CHECKLOG
32+
# CHECKDIR = .checkdir
33+
# RT_FLAGS =
34+
# INPSDIR =
35+
#
36+
#######################################################################################
37+
38+
include $(SACBASE)/Makefiles/Makefile_template.prg

L5_advanced/Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#######################################################################################
2+
#
3+
# General Setup:
4+
#
5+
SAC2CFLAGS = -check tb -v 1 -O3
6+
7+
ifdef EXCLUDE_ERRORS
8+
SAC2CFLAGS += -DEXCLUDE_ERRORS
9+
endif
10+
11+
#
12+
# Setup for Makefile.standard:
13+
#
14+
# EXCLUDE_FILES =
15+
# TARGETDIR = .
16+
# LIBTARGETDIR = .
17+
# INCTARGETDIR = .
18+
# LIBSRCDIR = .
19+
# SUBDIRS =
20+
21+
#
22+
# Setup for Makefile.versions
23+
#
24+
# EXCLUDE_FILES_FOR_MT =
25+
# MAKE_MT_ALSO = yes
26+
# VERSDIR = .
27+
28+
#
29+
# Setup for Makefile.check:
30+
#
31+
CHECKLOGFILE = ./CHECKLOG
32+
# CHECKDIR = .checkdir
33+
# RT_FLAGS =
34+
# INPSDIR =
35+
#
36+
#######################################################################################
37+
38+
include $(SACBASE)/Makefiles/Makefile_template.prg
39+

L6_with-loop_basics/E-20.sac

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
use StdIO: all;
2+
use Array: all;
3+
4+
/*
5+
* NB: do compile with the option -check c !
6+
* you may use the compiler option -DGENERATOR_RANGE=GENERATOR_R1 !
7+
*/
8+
9+
#define GENERATOR_R1 ( [-2] <= iv < [3])
10+
#define GENERATOR_R2 ( [0] <= iv < [8])
11+
#define GENERATOR_R3 ( [6] <= iv < [5])
12+
#define GENERATOR_R4 ( [8] <= iv < [5])
13+
#define GENERATOR_R5 ( [6] <= iv < [0])
14+
15+
#ifndef GENERATOR_RANGE
16+
#define GENERATOR_RANGE GENERATOR_R3
17+
#endif
18+
19+
int main()
20+
{
21+
a = with {
22+
GENERATOR_RANGE : 42;
23+
} : genarray( [7], 0);
24+
25+
print(a);
26+
27+
return(0);
28+
}
29+
30+

L6_with-loop_basics/E-21.sac

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use StdIO: all;
2+
use Array: all;
3+
4+
int main()
5+
{
6+
a = with {
7+
( . <= [i,j] <= .) : (i+j) % 10 ;
8+
} : genarray( [10,10], 0);
9+
10+
print(a);
11+
12+
return(0);
13+
}
14+

L6_with-loop_basics/Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#######################################################################################
2+
#
3+
# General Setup:
4+
#
5+
SAC2CFLAGS = -check tb -v 1 -O3
6+
7+
ifdef EXCLUDE_ERRORS
8+
SAC2CFLAGS += -DEXCLUDE_ERRORS
9+
endif
10+
11+
#
12+
# Setup for Makefile.standard:
13+
#
14+
EXCLUDE_FILES = generator_ranges.sac
15+
# TARGETDIR = .
16+
# LIBTARGETDIR = .
17+
# INCTARGETDIR = .
18+
# LIBSRCDIR = .
19+
# SUBDIRS =
20+
21+
#
22+
# Setup for Makefile.versions
23+
#
24+
# EXCLUDE_FILES_FOR_MT =
25+
# MAKE_MT_ALSO = yes
26+
# VERSDIR = .
27+
28+
#
29+
# Setup for Makefile.check:
30+
#
31+
CHECKLOGFILE = ./CHECKLOG
32+
# CHECKDIR = .checkdir
33+
# RT_FLAGS =
34+
# INPSDIR =
35+
#
36+
#######################################################################################
37+
38+
include $(SACBASE)/Makefiles/Makefile_template.prg
39+

0 commit comments

Comments
 (0)