~ubuntu-branches/ubuntu/wily/styx/wily

« back to all changes in this revision

Viewing changes to examples/example01/mx

  • Committer: Package Import Robot
  • Author(s): Frederik Schüler
  • Date: 2013-12-28 18:20:37 UTC
  • mfrom: (0.1.5)
  • Revision ID: package-import@ubuntu.com-20131228182037-ihsf1de5y1oe24nf
Tags: 2.0.1-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh -e
2
 
# [mx] make 'calc'
3
 
 
4
 
# create subdirectories holding generated files if they don't exist
5
 
for subdir in img gen inc prj ; do
6
 
  [ -d ${subdir} ] || mkdir ${subdir}
7
 
done
8
 
 
9
 
INCLUDES="-I./inc -I${prefix}/include"
10
 
 
11
 
# For static linking, you may need to uncomment these 2 lines
12
 
# LDFLAGS=-static
13
 
# LIBS="-ldl -lrt -lpthread"
14
 
 
15
 
#destination directory for parser and scanner table image files
16
 
BINSTYX=./img
17
 
#destination directory for parser and scanner table and term interface source files
18
 
GENSTYX=./gen
19
 
#source directory of language specification file
20
 
SPESTYX=.
21
 
 
22
 
export BINSTYX GENSTYX SPESTYX
23
 
 
24
 
#create source files
25
 
styx calc -makeC -makeINT -verbose
26
 
 
27
 
#create header files for generated c-sources
28
 
ctoh -ct -CPATH=./gen -HPATH=./inc -PRJ=./prj 
29
 
 
30
 
#compile sources to program 'calctut'
31
 
gcc ${CFLAGS} ${INCLUDES} ${LDFLAGS} \
32
 
        calctut.c ./gen/calc_pim.c ./gen/calc_lim.c ./gen/calc_int.c \
33
 
        -ldstyx ${LIBS} \
34
 
        -o calctut