Skip to content

Commit ff3e3cc

Browse files
committed
--language -> -x
1 parent ad0db15 commit ff3e3cc

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/prorab.mk

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -546,14 +546,16 @@ $(prorab-private-generate-test-source-file-recepie)
546546
$(prorab_this_hxx_test_objs): $(d)%.o: $(d)%
547547
$(.RECIPEPREFIX)@test -t 1 && printf "\e[1;34mcompile\e[0m $$(patsubst $(prorab_root_dir)%,%,$$<)\n" || printf "compile $$(patsubst $(prorab_root_dir)%,%,$$<)\n"
548548
$(.RECIPEPREFIX)$(a)mkdir -p $$(dir $$@)
549-
$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_cxx) --language c++ -c -MF "$$(patsubst %.o,%.d,$$@)" -MD -MP $(this_cxxflags_test) -o "$$@" $$<)
549+
# NOTE: using short -x option instead of --language because some compilers (e.g. emcc) only support -x
550+
$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_cxx) -x c++ -c -MF "$$(patsubst %.o,%.d,$$@)" -MD -MP $(this_cxxflags_test) -o "$$@" $$<)
550551
$(.RECIPEPREFIX)$(a)$(prorab_private_d_file_sed_command)
551552

552553
# compile .h.test_c static pattern rule
553554
$(prorab_this_h_test_objs): $(d)%.o: $(d)%
554555
$(.RECIPEPREFIX)@test -t 1 && printf "\e[0;35mcompile\e[0m $$(patsubst $(prorab_root_dir)%,%,$$<)\n" || printf "compile $$(patsubst $(prorab_root_dir)%,%,$$<)\n"
555556
$(.RECIPEPREFIX)$(a)mkdir -p $$(dir $$@)
556-
$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_cc) --language c -c -MF "$$(patsubst %.o,%.d,$$@)" -MD -MP $(this_cflags_test) -o "$$@" $$<)
557+
# NOTE: using short -x option instead of --language because some compilers (e.g. emcc) only support -x
558+
$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_cc) -x c -c -MF "$$(patsubst %.o,%.d,$$@)" -MD -MP $(this_cflags_test) -o "$$@" $$<)
557559
$(.RECIPEPREFIX)$(a)$(prorab_private_d_file_sed_command)
558560

559561
# include rules for header dependencies
@@ -800,30 +802,34 @@ $(prorab-private-generate-test-source-file-recepie)
800802
$(prorab_this_cxx_objs): $(prorab_this_obj_dir)$(prorab_this_obj_spacer)%.o: $(d)% $(prorab_cxxflags_file)
801803
$(.RECIPEPREFIX)@test -t 1 && printf "\e[1;34mcompile\e[0m $$(patsubst $(prorab_root_dir)%,%,$$<)\n" || printf "compile $$(patsubst $(prorab_root_dir)%,%,$$<)\n"
802804
$(.RECIPEPREFIX)$(a)mkdir -p $$(dir $$@)
803-
$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_cxx) --language c++ -c -MF "$$(patsubst %.o,%.d,$$@)" -MD -MP -o "$$@" $(prorab_cxxflags) $$<)
805+
# NOTE: using short -x option instead of --language because some compilers (e.g. emcc) only support -x
806+
$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_cxx) -x c++ -c -MF "$$(patsubst %.o,%.d,$$@)" -MD -MP -o "$$@" $(prorab_cxxflags) $$<)
804807
$(.RECIPEPREFIX)$(a)$(prorab_private_d_file_sed_command)
805808
$(if $(this_lint_cmd),$(if $(filter $(lint),off),,$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_lint_cmd))))
806809

807810
# compile .hpp.hdr_cpp static pattern rule
808811
$(prorab_this_hxx_objs): $(d)%.o: $(d)% $(prorab_cxxflags_file)
809812
$(.RECIPEPREFIX)@test -t 1 && printf "\e[1;34mcompile\e[0m $$(patsubst $(prorab_root_dir)%,%,$$<)\n" || printf "compile $$(patsubst $(prorab_root_dir)%,%,$$<)\n"
810813
$(.RECIPEPREFIX)$(a)mkdir -p $$(dir $$@)
811-
$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_cxx) --language c++ -c -MF "$$(patsubst %.o,%.d,$$@)" -MD -MP -o "$$@" $(prorab_cxxflags) $$<)
814+
# NOTE: using short -x option instead of --language because some compilers (e.g. emcc) only support -x
815+
$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_cxx) -x c++ -c -MF "$$(patsubst %.o,%.d,$$@)" -MD -MP -o "$$@" $(prorab_cxxflags) $$<)
812816
$(.RECIPEPREFIX)$(a)$(prorab_private_d_file_sed_command)
813817

814818
# compile .c static pattern rule
815819
$(prorab_this_c_objs): $(prorab_this_obj_dir)$(prorab_this_obj_spacer)%.o: $(d)% $(prorab_cflags_file)
816820
$(.RECIPEPREFIX)@test -t 1 && printf "\e[0;35mcompile\e[0m $$(patsubst $(prorab_root_dir)%,%,$$<)\n" || printf "compile $$(patsubst $(prorab_root_dir)%,%,$$<)\n"
817821
$(.RECIPEPREFIX)$(a)mkdir -p $$(dir $$@)
818-
$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_cc) --language c -c -MF "$$(patsubst %.o,%.d,$$@)" -MD -MP -o "$$@" $(prorab_cflags) $$<)
822+
# NOTE: using short -x option instead of --language because some compilers (e.g. emcc) only support -x
823+
$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_cc) -x c -c -MF "$$(patsubst %.o,%.d,$$@)" -MD -MP -o "$$@" $(prorab_cflags) $$<)
819824
$(.RECIPEPREFIX)$(a)$(prorab_private_d_file_sed_command)
820825
$(if $(this_lint_cmd),$(if $(filter $(lint),off),,$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_lint_cmd))))
821826

822827
# compile .h.hdr_c static pattern rule
823828
$(prorab_this_h_objs): $(d)%.o: $(d)% $(prorab_cflags_file)
824829
$(.RECIPEPREFIX)@test -t 1 && printf "\e[0;35mcompile\e[0m $$(patsubst $(prorab_root_dir)%,%,$$<)\n" || printf "compile $$(patsubst $(prorab_root_dir)%,%,$$<)\n"
825830
$(.RECIPEPREFIX)$(a)mkdir -p $$(dir $$@)
826-
$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_cc) --language c -c -MF "$$(patsubst %.o,%.d,$$@)" -MD -MP -o "$$@" $(prorab_cflags) $$<)
831+
# NOTE: using short -x option instead of --language because some compilers (e.g. emcc) only support -x
832+
$(.RECIPEPREFIX)$(a)(cd $(d) && $(this_cc) -x c -c -MF "$$(patsubst %.o,%.d,$$@)" -MD -MP -o "$$@" $(prorab_cflags) $$<)
827833
$(.RECIPEPREFIX)$(a)$(prorab_private_d_file_sed_command)
828834

829835
# compile .S static pattern rule

0 commit comments

Comments
 (0)