From 8529bd86481b5b2f04a0cddd4f6376b82f23b952 Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Thu, 4 Feb 2016 15:48:29 -0600 Subject: [PATCH] make_makefile_swig writing duplicate rules Used a hash instead of an array to store the names of files that we need to process. This eliminates duplicates. refs #175 --- libexec/trick/make_makefile_swig | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libexec/trick/make_makefile_swig b/libexec/trick/make_makefile_swig index cc05f7e1..431021c5 100755 --- a/libexec/trick/make_makefile_swig +++ b/libexec/trick/make_makefile_swig @@ -134,7 +134,6 @@ sub make_swig_makefile() { my ($n , $f , $k , $m); my %temp_hash ; - my (@temp_array) ; my ($ii) ; my ($swig_sim_dir, $swig_src_dir) ; my (%py_module_map) ; @@ -160,9 +159,9 @@ sub make_swig_makefile() { } } next if ( $continue == 0 ) ; - push @temp_array , $f ; + $temp_hash{$f} = 1; } - @files_to_process = @temp_array ; + @files_to_process = sort keys %temp_hash ; open MAKEFILE , ">build/Makefile_swig" or return ; open LINK_PY_OBJS , ">build/link_py_objs" or return ; @@ -171,7 +170,7 @@ sub make_swig_makefile() { print MAKEFILE "\ # SWIG rule -SWIG_FLAGS = +SWIG_FLAGS ?= SWIG_CFLAGS := -I../include \${PYTHON_INCLUDES} -Wno-shadow -Wno-missing-field-initializers ifeq (\$(IS_CC_CLANG), 1) SWIG_CFLAGS += -Wno-self-assign -Wno-sometimes-uninitialized