Skip to content

Commit 8cf67b9

Browse files
committed
added L9 examples
1 parent ffe51a4 commit 8cf67b9

4 files changed

Lines changed: 59 additions & 0 deletions

File tree

L9_c4sac/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

L9_c4sac/simple.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "simple.h"
2+
3+
int add(int x, int y) 4{
4+
return x + y;
5+
}
6+

L9_c4sac/simple.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef SIMPLE_H
2+
#define SIMPLE_H
3+
4+
extern int add(int x, int y); 5
5+
6+
#endif

L9_c4sac/simple.sac

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
external int add(double x, double y);
2+
#pragma linkobj "simple.o"
3+
#pragma header "simple.h"
4+
5+
int main()
6+
{
7+
StdIO::printf("1 plus 1 is %d\n", add( 1, 1));
8+
return 0;
9+
}

0 commit comments

Comments
 (0)