2

I am looking for a tool which can generate makefile for Sun CC compiler from an existing makefile , which is actually written for GCC compiler.Is there any tool which does the same? I tried by setting CC on the command line.sometimes it worked. But there are a lot of compiler specific flags , hardcoded in the Makefile. How this can be handled?I could find this answer. https://stackoverflow.com/questions/2969222/make-gnu-make-use-a-different-compiler. But how this works if the makefile has compiler dependent hard coded flags?

  • 1
    Typically you just set a variable CC (maybe on the command line) and use the existing Makefile. What have you tried? – icarus Jan 16 '17 at 5:04
  • 4
    Welcome to Stack Exchange.  It would appear that you have accidentally created two accounts.  You should use the contact form and select “I need to merge user profiles” to have your accounts merged.  In order to merge them, you will need to provide links to the two accounts.  For your information, these are unix.stackexchange.com/users/210654/ash and unix.stackexchange.com/users/210666/ashal.  You’ll then be able to edit, comment on, and accept answers to this question. – G-Man Jan 16 '17 at 5:44
  • To start off, you could delete the flags that are not recognised by SUN's compiler, while taking notes about what the flags you delete does in GCC. Then you can look for equivalent flags in the SUN compiler documentation. – Kusalananda Jan 16 '17 at 7:40
  • Rather than generating a makefile, the sane way to do this would be to write a wrapper called gcc that parses its command line arguments and calls suncc with corresponding options where possible. – Gilles Jan 16 '17 at 23:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.