Handling command line arguments?

2017-05-09 Thread Artyom Shalkhakov
Hi all,

Is there a ready-made library for handling command line parameters?

So far I found the following:

https://github.com/githwxi/ATS-Postiats/blob/master/utils/jsonlst2arr/jsonlst2arr.dats

Which sets up an example of what HX thinks should be done to deal with 
command-line arguments. Would somebody like to move it into a library?

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/3f70c312-504e-417c-8ee4-282cf0e22b41%40googlegroups.com.


Re: undeclared error when defined in SATS

2017-05-09 Thread Mike Jones
Ok, I was dumb to include "with"

It compiles now.

Is there some doc explaining the meaning of the changed bracketing?


On Tuesday, May 9, 2017 at 3:44:14 PM UTC-6, Mike Jones wrote:
>
> I get this exception:
>
> patsopt -o DATS/process_dats.c.tmp -d DATS/process.dats
> /home/michael/share/design/code/uPuckFX3/SATS/frames.sats: 28(line=3, offs
> =1) -- 32(line=3, offs=5): error(parsing): the token is discarded.
> exit(ATS): uncaught exception: 
> _2home_2hwxi_2Research_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorExn
> (1025)
> makefile:79: recipe for target 'DATS/process_dats.c' failed
> make: *** [DATS/process_dats.c] Error 1
>
> with code:
>
> %{#
> // The max size of an In Frame is 1024 bytes.
> extern uint8_t packetInData[1024];
> extern const uint8_t *packetIn;
> extern const uint16_t *packetInCount;
> extern const uint8_t *packetInHeader;
> extern const uint8_t *packetInContents;
> extern const uint8_t *smbusInControl;
> extern const uint8_t *smbusInProtocol;
> extern const uint8_t *smbusInAddress;
> extern const uint8_t *smbusInCommand;
> extern const uint8_t *smbusInData0;
> extern const uint8_t *smbusInData1;
>
> // The max size of an Out Frame is 1024 bytes;
> extern uint8_t packetOutData[1024];
> extern const uint8_t *packetOut;
> extern const uint16_t *packetOutCount;
> extern const uint8_t *packetOutHeader;
> extern const uint8_t *packetOutContents;
> extern const uint8_t *smbusOutProtocol;
> extern const uint8_t *smbusOutBlock;
>
> %}
>
> Perhaps something in the closing bracket needs change?
>

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/e59037ae-a98a-4df0-8400-f23c2dec3f05%40googlegroups.com.


Re: undeclared error when defined in SATS

2017-05-09 Thread Mike Jones
I get this exception:

patsopt -o DATS/process_dats.c.tmp -d DATS/process.dats
/home/michael/share/design/code/uPuckFX3/SATS/frames.sats: 28(line=3, offs=1
) -- 32(line=3, offs=5): error(parsing): the token is discarded.
exit(ATS): uncaught exception: 
_2home_2hwxi_2Research_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorExn
(1025)
makefile:79: recipe for target 'DATS/process_dats.c' failed
make: *** [DATS/process_dats.c] Error 1

with code:

%{#
// The max size of an In Frame is 1024 bytes.
extern uint8_t packetInData[1024];
extern const uint8_t *packetIn;
extern const uint16_t *packetInCount;
extern const uint8_t *packetInHeader;
extern const uint8_t *packetInContents;
extern const uint8_t *smbusInControl;
extern const uint8_t *smbusInProtocol;
extern const uint8_t *smbusInAddress;
extern const uint8_t *smbusInCommand;
extern const uint8_t *smbusInData0;
extern const uint8_t *smbusInData1;

// The max size of an Out Frame is 1024 bytes;
extern uint8_t packetOutData[1024];
extern const uint8_t *packetOut;
extern const uint16_t *packetOutCount;
extern const uint8_t *packetOutHeader;
extern const uint8_t *packetOutContents;
extern const uint8_t *smbusOutProtocol;
extern const uint8_t *smbusOutBlock;

%}

Perhaps something in the closing bracket needs change?

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/03905339-4d03-4b19-8b79-560dffc0562b%40googlegroups.com.


undeclared error when defined in SATS

2017-05-09 Thread Mike Jones
This is another problem related to moving from 2.4 to 3.4 compiler.

The compiler error:

DATS/process_dats.c: In function 
'_057_home_057_michael_057_share_057_design_057_code_057_uPuckFX3_057_DATS_057_frames_056_dats__validate_in_frame__38__1'
:
DATS/process_dats.c:4185:145: error: 'packetInCount' undeclared (first use 
in this function)
 ATSINSmove(tmp97__1, 
_057_home_057_michael_057_share_057_design_057_code_057_uPuckFX3_057_DATS_057_numbers_056_dats__n10_
(ATSderef(ATSPMVextval(packetInCount), atstkind_t0ype(atstype_uint16 ;


Is used in the said file, with these includes:

#include "share/atspre_staload.hats"

staload CH = "prelude/SATS/char.sats"
staload UN = "prelude/SATS/unsafe.sats"
staload _ = "prelude/DATS/unsafe.dats"

...
staload "SATS/frames.sats"
staload "DATS/frames.dats"
...

In frames.sats:

staload "SATS/state.sats"

%{^
extern uint8_t packetInData[1024];
extern const uint8_t *packetIn;
extern const uint16_t *packetInCount;

In frames.dats:

#include "share/atspre_staload.hats"

staload UN = "prelude/SATS/unsafe.sats"
staload _ = "prelude/DATS/unsafe.dats"

%{^
uint8_t packetInData[1024] __attribute__ ((aligned (32)));
const uint8_t  *packetIn = packetInData;
const uint16_t *packetInCount= (uint16_t*)packetInData;

Looking in frames_dats.c, the variables are defined, but nothing creates a 
frames_dats.h file with externs.

Looks like I need to do something to create headers that would be included?

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/9d2b9dba-14da-4149-9d3c-a05cf6fc89ba%40googlegroups.com.


Re: PMVtmpltcstmat undefined when using pointers.dats

2017-05-09 Thread Mike Jones
I would fix this compile message and lead to a different problem to solve 
:-)

On Tuesday, May 9, 2017 at 11:46:40 AM UTC-6, gmhwxi wrote:
>
>
> What would happen if you add
>
> #include "share/atspre_staload.hats"
>
> after removing the following lines:
>
> staload _ = "prelude/DATS/pointer.dats"
> staload _ = "prelude/DATS/array.dats"
> staload _ = "prelude/DATS/arrayptr.dats"
> staload _ = "prelude/DATS/arrayref.dats"
> staload _ = "prelude/DATS/string.dats"
> staload _ = "prelude/DATS/integer.dats"
> staload _ = "prelude/DATS/integer_fixed.dats"
>
> On Tue, May 9, 2017 at 1:32 PM, Mike Jones  > wrote:
>
>> I upgraded my ATS compiler from 2.4 to 3.4 and now have a new compiler 
>> error that I have failed to fix, and need a few pointers.
>>
>> This application is not using the run time, as the code is linked into a 
>> larger application using an RTOS in an FX3. The application was fully 
>> working before the compiler upgrade.
>>
>> A file named frames.dats has the following code at the top:
>>
>> staload _ = "prelude/DATS/pointer.dats"
>> staload _ = "prelude/DATS/array.dats"
>> staload _ = "prelude/DATS/arrayptr.dats"
>> staload _ = "prelude/DATS/arrayref.dats"
>> staload _ = "prelude/DATS/string.dats"
>> staload _ = "prelude/DATS/integer.dats"
>> staload _ = "prelude/DATS/integer_fixed.dats"
>> staload UN = "prelude/SATS/unsafe.sats"
>> staload _ = "prelude/DATS/unsafe.dats"
>>
>>
>> and this leads to the following compiler error:
>>
>> In file included from DATS/frames_dats.c:15:0:
>> DATS/frames_dats.c: In function 
>> 'ATSLIB_056_prelude__ptr0_add_gint__12__1':
>> DATS/frames_dats.c:2341:22: error: 'PMVtmpltcstmat' undeclared (first use 
>> in this function)
>>  ATSINSmove(tmp28__1, PMVtmpltcstmat[0](g0int2uint> ), S2Eextkind(atstype_size)>)(arg1)) ;
>>
>>
>> Looking at the generated code around line 2341:
>>
>> /*
>> emit_instr: loc0 = 
>> /usr/local/lib/ats2-postiats-0.3.4/prelude/DATS/pointer.dats: 2125(line=81, 
>> offs=18) -- 2137(line=81, offs=30)
>> */
>> ATSINSmove(tmp28__1, PMVtmpltcstmat[0](g0int2uint> ), S2Eextkind(atstype_size)>)(arg1)) ;
>>
>> we can see the error came from compiling pointer.dats
>>
>> which has this code at line 81:
>>
>> implement
>> {a}{tk}
>> ptr0_add_gint(p, i) =
>>   add_ptr_bsz(p, g0int2uint(i) * sizeof)
>> implement
>> {a}{tk}
>> ptr0_sub_gint(p, i) =
>>   sub_ptr_bsz(p, g0int2uint(i) * sizeof)
>>
>> I tried adding this at the top of frames.dats per other discussions in 
>> the group
>>
>> #include "share/atspre_staload.hats"
>>
>> but it does not help.
>>
>> My make file does not use the ATS .mk files, so I am providing my 
>> makefile in case I missed something important.
>>
>> Does anyone have any ideas on the root cause?
>>
>> FX3FWROOT=/opt/share/cypress/cyfx3sdk
>>
>> ATS= $(wildcard SATS/*.sats)
>> DATS   = $(wildcard DATS/*.dats)
>> DATSC  = $(patsubst %.dats,%_dats.c,$(DATS))
>> DATSOBJ= $(patsubst %.dats,%_dats.o,$(DATS))
>>
>> ATS= patsopt
>> ATSCFLAGS  = -std=c99 -D_XOPEN_SOURCE
>> ATSCFLAGS  += -D_ATS_CCOMP_EXCEPTION_NONE_ -D_ATS_CCOMP_RUNTIME_NONE_ 
>> ATSCFLAGS  += -Wno-unused-variable -Wno-unused-label 
>> -Wno-unused-but-set-variable
>> ATSCFLAGS  += -I. -I${PATSHOME} -I${PATSHOME}/ccomp/runtime 
>> ATSCFLAGS  += -DATS_MEMALLOC_LIBC
>>
>> USER_CFLAGS = $(ATSCFLAGS)
>>
>> CYCONFOPT = fx3_profile_release
>>
>> all:compile
>>
>> include $(FX3FWROOT)/fw_build/fx3_fw/fx3_build_config.mak
>>
>> MODULE = upuck
>>
>> SOURCE= $(MODULE).c \
>> dscr.c\
>> cyfxtx.c \
>> smbus.c \
>> fetch.c \
>> apperror.c \
>> DATS/print_dats.c \
>> DATS/frames_dats.c \
>> DATS/numbers_dats.c \
>> DATS/polling_dats.c \
>> DATS/crc_dats.c \
>> DATS/smbus_dats.c \
>> DATS/process_dats.c
>>
>> ifeq ($(CYFXBUILD),arm)
>> SOURCE_ASM=cyfx_startup.S
>> else
>> SOURCE_ASM=cyfx_gcc_startup.S
>> endif
>>
>> C_OBJECT=$(SOURCE:%.c=./%.o)
>> A_OBJECT=$(SOURCE_ASM:%.S=./%.o)
>>
>> EXES = $(MODULE).$(EXEEXT)
>>
>> $(MODULE).$(EXEEXT): $(A_OBJECT) $(C_OBJECT)
>> $(LINK)
>>
>> cyfxtx.c:
>> cp $(FX3FWROOT)/fw_build/fx3_fw/cyfxtx.c .
>>
>> cyfx_startup.S:
>> cp $(FX3FWROOT)/fw_build/fx3_fw/cyfx_startup.S .
>>
>> cyfx_gcc_startup.S:
>> cp $(FX3FWROOT)/fw_build/fx3_fw/cyfx_gcc_startup.S .
>>
>> $(DATSC): %_dats.c: %.dats $(SATS)
>> $(ATS) -o $@.tmp -d $<
>> mv $@.tmp $@
>>
>> $(C_OBJECT) : %.o : %.c
>> $(COMPILE)
>>
>> $(A_OBJECT) : %.o : %.S
>> $(ASSEMBLE)
>>
>> image:
>> -@echo 'Generate boot-loadable binary image'
>> -/opt/cypress/cyfx3sdk/util/elf2img/elf2img -i upuck.elf -o upuck.img 
>> -v
>> -@echo ' '
>>
>> clean:
>> rm -f ./$(MODULE).$(EXEEXT)
>> rm -f ./$(MODULE).map
>> rm -f ./*.o DATS/*.o DATS/*.c
>> rm -f cyfxtx.c cyfx_startup.S cyfx_gcc_startup.S
>>
>>
>> 

Re: PMVtmpltcstmat undefined when using pointers.dats

2017-05-09 Thread Hongwei Xi
What would happen if you add

#include "share/atspre_staload.hats"

after removing the following lines:

staload _ = "prelude/DATS/pointer.dats"
staload _ = "prelude/DATS/array.dats"
staload _ = "prelude/DATS/arrayptr.dats"
staload _ = "prelude/DATS/arrayref.dats"
staload _ = "prelude/DATS/string.dats"
staload _ = "prelude/DATS/integer.dats"
staload _ = "prelude/DATS/integer_fixed.dats"

On Tue, May 9, 2017 at 1:32 PM, Mike Jones  wrote:

> I upgraded my ATS compiler from 2.4 to 3.4 and now have a new compiler
> error that I have failed to fix, and need a few pointers.
>
> This application is not using the run time, as the code is linked into a
> larger application using an RTOS in an FX3. The application was fully
> working before the compiler upgrade.
>
> A file named frames.dats has the following code at the top:
>
> staload _ = "prelude/DATS/pointer.dats"
> staload _ = "prelude/DATS/array.dats"
> staload _ = "prelude/DATS/arrayptr.dats"
> staload _ = "prelude/DATS/arrayref.dats"
> staload _ = "prelude/DATS/string.dats"
> staload _ = "prelude/DATS/integer.dats"
> staload _ = "prelude/DATS/integer_fixed.dats"
> staload UN = "prelude/SATS/unsafe.sats"
> staload _ = "prelude/DATS/unsafe.dats"
>
>
> and this leads to the following compiler error:
>
> In file included from DATS/frames_dats.c:15:0:
> DATS/frames_dats.c: In function 'ATSLIB_056_prelude__ptr0_add_gint__12__1'
> :
> DATS/frames_dats.c:2341:22: error: 'PMVtmpltcstmat' undeclared (first use
> in this function)
>  ATSINSmove(tmp28__1, PMVtmpltcstmat[0](g0int2uint ), S2Eextkind(atstype_size)>)(arg1)) ;
>
>
> Looking at the generated code around line 2341:
>
> /*
> emit_instr: loc0 = /usr/local/lib/ats2-postiats-
> 0.3.4/prelude/DATS/pointer.dats: 2125(line=81, offs=18) -- 2137(line=81,
> offs=30)
> */
> ATSINSmove(tmp28__1, PMVtmpltcstmat[0](g0int2uint S2Eextkind(atstype_size)>)(arg1)) ;
>
> we can see the error came from compiling pointer.dats
>
> which has this code at line 81:
>
> implement
> {a}{tk}
> ptr0_add_gint(p, i) =
>   add_ptr_bsz(p, g0int2uint(i) * sizeof)
> implement
> {a}{tk}
> ptr0_sub_gint(p, i) =
>   sub_ptr_bsz(p, g0int2uint(i) * sizeof)
>
> I tried adding this at the top of frames.dats per other discussions in the
> group
>
> #include "share/atspre_staload.hats"
>
> but it does not help.
>
> My make file does not use the ATS .mk files, so I am providing my makefile
> in case I missed something important.
>
> Does anyone have any ideas on the root cause?
>
> FX3FWROOT=/opt/share/cypress/cyfx3sdk
>
> ATS= $(wildcard SATS/*.sats)
> DATS   = $(wildcard DATS/*.dats)
> DATSC  = $(patsubst %.dats,%_dats.c,$(DATS))
> DATSOBJ= $(patsubst %.dats,%_dats.o,$(DATS))
>
> ATS= patsopt
> ATSCFLAGS  = -std=c99 -D_XOPEN_SOURCE
> ATSCFLAGS  += -D_ATS_CCOMP_EXCEPTION_NONE_ -D_ATS_CCOMP_RUNTIME_NONE_
> ATSCFLAGS  += -Wno-unused-variable -Wno-unused-label
> -Wno-unused-but-set-variable
> ATSCFLAGS  += -I. -I${PATSHOME} -I${PATSHOME}/ccomp/runtime
> ATSCFLAGS  += -DATS_MEMALLOC_LIBC
>
> USER_CFLAGS = $(ATSCFLAGS)
>
> CYCONFOPT = fx3_profile_release
>
> all:compile
>
> include $(FX3FWROOT)/fw_build/fx3_fw/fx3_build_config.mak
>
> MODULE = upuck
>
> SOURCE= $(MODULE).c \
> dscr.c\
> cyfxtx.c \
> smbus.c \
> fetch.c \
> apperror.c \
> DATS/print_dats.c \
> DATS/frames_dats.c \
> DATS/numbers_dats.c \
> DATS/polling_dats.c \
> DATS/crc_dats.c \
> DATS/smbus_dats.c \
> DATS/process_dats.c
>
> ifeq ($(CYFXBUILD),arm)
> SOURCE_ASM=cyfx_startup.S
> else
> SOURCE_ASM=cyfx_gcc_startup.S
> endif
>
> C_OBJECT=$(SOURCE:%.c=./%.o)
> A_OBJECT=$(SOURCE_ASM:%.S=./%.o)
>
> EXES = $(MODULE).$(EXEEXT)
>
> $(MODULE).$(EXEEXT): $(A_OBJECT) $(C_OBJECT)
> $(LINK)
>
> cyfxtx.c:
> cp $(FX3FWROOT)/fw_build/fx3_fw/cyfxtx.c .
>
> cyfx_startup.S:
> cp $(FX3FWROOT)/fw_build/fx3_fw/cyfx_startup.S .
>
> cyfx_gcc_startup.S:
> cp $(FX3FWROOT)/fw_build/fx3_fw/cyfx_gcc_startup.S .
>
> $(DATSC): %_dats.c: %.dats $(SATS)
> $(ATS) -o $@.tmp -d $<
> mv $@.tmp $@
>
> $(C_OBJECT) : %.o : %.c
> $(COMPILE)
>
> $(A_OBJECT) : %.o : %.S
> $(ASSEMBLE)
>
> image:
> -@echo 'Generate boot-loadable binary image'
> -/opt/cypress/cyfx3sdk/util/elf2img/elf2img -i upuck.elf -o upuck.img
> -v
> -@echo ' '
>
> clean:
> rm -f ./$(MODULE).$(EXEEXT)
> rm -f ./$(MODULE).map
> rm -f ./*.o DATS/*.o DATS/*.c
> rm -f cyfxtx.c cyfx_startup.S cyfx_gcc_startup.S
>
>
> compile: $(C_OBJECT) $(A_OBJECT) $(EXES)
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "ats-lang-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ats-lang-users+unsubscr...@googlegroups.com.
> To post to this group, send email to 

PMVtmpltcstmat undefined when using pointers.dats

2017-05-09 Thread Mike Jones
I upgraded my ATS compiler from 2.4 to 3.4 and now have a new compiler 
error that I have failed to fix, and need a few pointers.

This application is not using the run time, as the code is linked into a 
larger application using an RTOS in an FX3. The application was fully 
working before the compiler upgrade.

A file named frames.dats has the following code at the top:

staload _ = "prelude/DATS/pointer.dats"
staload _ = "prelude/DATS/array.dats"
staload _ = "prelude/DATS/arrayptr.dats"
staload _ = "prelude/DATS/arrayref.dats"
staload _ = "prelude/DATS/string.dats"
staload _ = "prelude/DATS/integer.dats"
staload _ = "prelude/DATS/integer_fixed.dats"
staload UN = "prelude/SATS/unsafe.sats"
staload _ = "prelude/DATS/unsafe.dats"


and this leads to the following compiler error:

In file included from DATS/frames_dats.c:15:0:
DATS/frames_dats.c: In function 'ATSLIB_056_prelude__ptr0_add_gint__12__1':
DATS/frames_dats.c:2341:22: error: 'PMVtmpltcstmat' undeclared (first use in 
this function)
 ATSINSmove(tmp28__1, PMVtmpltcstmat[0](g0int2uint)(arg1)) ;


Looking at the generated code around line 2341:

/*
emit_instr: loc0 = 
/usr/local/lib/ats2-postiats-0.3.4/prelude/DATS/pointer.dats: 2125(line=81, 
offs=18) -- 2137(line=81, offs=30)
*/
ATSINSmove(tmp28__1, PMVtmpltcstmat[0](g0int2uint)(arg1)) ;

we can see the error came from compiling pointer.dats

which has this code at line 81:

implement
{a}{tk}
ptr0_add_gint(p, i) =
  add_ptr_bsz(p, g0int2uint(i) * sizeof)
implement
{a}{tk}
ptr0_sub_gint(p, i) =
  sub_ptr_bsz(p, g0int2uint(i) * sizeof)

I tried adding this at the top of frames.dats per other discussions in the 
group

#include "share/atspre_staload.hats"

but it does not help.

My make file does not use the ATS .mk files, so I am providing my makefile 
in case I missed something important.

Does anyone have any ideas on the root cause?

FX3FWROOT=/opt/share/cypress/cyfx3sdk

ATS= $(wildcard SATS/*.sats)
DATS   = $(wildcard DATS/*.dats)
DATSC  = $(patsubst %.dats,%_dats.c,$(DATS))
DATSOBJ= $(patsubst %.dats,%_dats.o,$(DATS))

ATS= patsopt
ATSCFLAGS  = -std=c99 -D_XOPEN_SOURCE
ATSCFLAGS  += -D_ATS_CCOMP_EXCEPTION_NONE_ -D_ATS_CCOMP_RUNTIME_NONE_ 
ATSCFLAGS  += -Wno-unused-variable -Wno-unused-label 
-Wno-unused-but-set-variable
ATSCFLAGS  += -I. -I${PATSHOME} -I${PATSHOME}/ccomp/runtime 
ATSCFLAGS  += -DATS_MEMALLOC_LIBC

USER_CFLAGS = $(ATSCFLAGS)

CYCONFOPT = fx3_profile_release

all:compile

include $(FX3FWROOT)/fw_build/fx3_fw/fx3_build_config.mak

MODULE = upuck

SOURCE= $(MODULE).c \
dscr.c\
cyfxtx.c \
smbus.c \
fetch.c \
apperror.c \
DATS/print_dats.c \
DATS/frames_dats.c \
DATS/numbers_dats.c \
DATS/polling_dats.c \
DATS/crc_dats.c \
DATS/smbus_dats.c \
DATS/process_dats.c

ifeq ($(CYFXBUILD),arm)
SOURCE_ASM=cyfx_startup.S
else
SOURCE_ASM=cyfx_gcc_startup.S
endif

C_OBJECT=$(SOURCE:%.c=./%.o)
A_OBJECT=$(SOURCE_ASM:%.S=./%.o)

EXES = $(MODULE).$(EXEEXT)

$(MODULE).$(EXEEXT): $(A_OBJECT) $(C_OBJECT)
$(LINK)

cyfxtx.c:
cp $(FX3FWROOT)/fw_build/fx3_fw/cyfxtx.c .

cyfx_startup.S:
cp $(FX3FWROOT)/fw_build/fx3_fw/cyfx_startup.S .

cyfx_gcc_startup.S:
cp $(FX3FWROOT)/fw_build/fx3_fw/cyfx_gcc_startup.S .

$(DATSC): %_dats.c: %.dats $(SATS)
$(ATS) -o $@.tmp -d $<
mv $@.tmp $@

$(C_OBJECT) : %.o : %.c
$(COMPILE)

$(A_OBJECT) : %.o : %.S
$(ASSEMBLE)

image:
-@echo 'Generate boot-loadable binary image'
-/opt/cypress/cyfx3sdk/util/elf2img/elf2img -i upuck.elf -o upuck.img -v
-@echo ' '

clean:
rm -f ./$(MODULE).$(EXEEXT)
rm -f ./$(MODULE).map
rm -f ./*.o DATS/*.o DATS/*.c
rm -f cyfxtx.c cyfx_startup.S cyfx_gcc_startup.S


compile: $(C_OBJECT) $(A_OBJECT) $(EXES)



-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/d49957aa-782c-47f3-b6a5-6e63df153af7%40googlegroups.com.