Using make for cross platform compilation

前端 未结 6 1762
野趣味
野趣味 2021-02-05 05:03

I am currently developing a C project under Linux and Win32. The \'deliverable\' is a shared library, and all the development is done under Linux with the GNU tool chain. I am u

6条回答
  •  情话喂你
    2021-02-05 05:43

    Use a single make file and put the platform-specifics in conditionals, eg

    ifeq ($(OS),Windows_NT)
        DLLEXT := .dll
    else
        DLLEXT := .so
    endif
    
    DLL := libfoo$(DLLEXT)
    
    lib : $(DLL)
    

提交回复
热议问题