Skip to content

Commit

Permalink
Make the -a option to ubx_tocarr optional
Browse files Browse the repository at this point in the history
We know make the -a option to ubx_tocarr optional, but we generate the
struct name from the filename. If we want the struct name to be different
to the convention of struct = filename_ext.

Signed-off-by: Hamish Guthrie <hamish.guthrie@kistler.com>
  • Loading branch information
Hamish Guthrie authored and kmarkus committed Nov 29, 2019
1 parent 3908c1c commit b7bda65
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion std_blocks/cppdemo/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ cppdemo_la_LIBADD = $(top_builddir)/libubx/libubx.la
cppdemo_la_CPPFLAGS = -I$(top_srcdir)/libubx

%.h.hexarr: %.h
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr -a $(basename $(notdir $<))$(subst .,_,$(suffix $<))
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr
2 changes: 1 addition & 1 deletion std_blocks/logging/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ BUILT_SOURCES = file_logger.lua.hexarr
CLEANFILES = $(BUILT_SOURCES)

%.lua.hexarr: %.lua
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr -a $(basename $(notdir $<))$(subst .,_,$(suffix $<))
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr

logger_la_includes = $(top_srcdir)/libubx/ubx.h \
$(top_srcdir)/libubx/ubx_types.h
Expand Down
2 changes: 1 addition & 1 deletion std_blocks/ptrig/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BUILT_SOURCES = types/ptrig_config.h.hexarr \
CLEANFILES = $(BUILT_SOURCES)

%.h.hexarr: %.h
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr -a $(basename $(notdir $<))$(subst .,_,$(suffix $<))
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr

ptrig_la_includes = $(top_srcdir)/libubx/ubx.h \
$(top_srcdir)/libubx/ubx_types.h
Expand Down
2 changes: 1 addition & 1 deletion std_blocks/random/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ random_la_LDFLAGS = -module -avoid-version -shared -export-dynamic
random_la_LIBADD = $(top_builddir)/libubx/libubx.la

%.h.hexarr: %.h
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr -a $(basename $(notdir $<))$(subst .,_,$(suffix $<))
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr
2 changes: 1 addition & 1 deletion std_blocks/trig/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ BUILT_SOURCES = types/trig_config.h.hexarr \
CLEANFILES = $(BUILT_SOURCES)

%.h.hexarr: %.h
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr -a $(basename $(notdir $<))$(subst .,_,$(suffix $<))
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr

trig_la_includes = $(top_srcdir)/libubx/ubx.h $(top_srcdir)/libubx/ubx_types.h
trig_la_SOURCES = $(trig_la_includes) trig.c
Expand Down
2 changes: 1 addition & 1 deletion std_blocks/webif/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ webif_la_LIBADD = $(top_builddir)/libubx/libubx.la
webif_la_CFLAGS = -I$(top_srcdir)/libubx $(LUAJIT_CFLAGS) @UBX_CFLAGS@

%.lua.hexarr: %.lua
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr -a $(basename $(notdir $<))$(subst .,_,$(suffix $<))
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr
2 changes: 1 addition & 1 deletion std_types/stattypes/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pkginclude_HEADERS = types/tstat.h \
types/tstat.h.hexarr

%.h.hexarr: %.h
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr -a $(basename $(notdir $<))$(subst .,_,$(suffix $<))
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr

# stattypes : The basic types
stattypes_la_includes = $(top_srcdir)/libubx/ubx.h
Expand Down
2 changes: 1 addition & 1 deletion std_types/testtypes/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BUILT_SOURCES = types/test_trig_conf.h.hexarr \
CLEANFILES = $(BUILT_SOURCES)

%.h.hexarr: %.h
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr -a $(basename $(notdir $<))$(subst .,_,$(suffix $<))
$(top_srcdir)/tools/ubx_tocarr -s $< -d $<.hexarr

# testtypes : The basic types
testtypes_la_includes = $(top_srcdir)/libubx/ubx.h
Expand Down
2 changes: 1 addition & 1 deletion tools/ubx_genblock
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ $(bm.name)_la_CPPFLAGS = -I${top_srcdir}/libubx @UBX_CFLAGS@
$(bm.name)_la_CFLAGS = -I${top_srcdir}/libubx @UBX_CFLAGS@
@ end
%.h.hexarr: %.h
ubx_tocarr -s $< -d $<.hexarr -a $(basename $(notdir $<))$(subst .,_,$(suffix $<))
ubx_tocarr -s $< -d $<.hexarr
]], { bm=bm, gen_built_sources=gen_built_sources, table=table })

Expand Down
3 changes: 1 addition & 2 deletions tools/ubx_tocarr
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ else
end

if not (opttab['-a'] and opttab['-a'][1]) then
usage()
os.exit(1)
structname = string.gsub(filename(srcfile), "[-.]", "_")
else
structname=opttab['-a'][1]
end
Expand Down

0 comments on commit b7bda65

Please sign in to comment.