Windows和Linux [英] Windows and Linux

查看:73
本文介绍了Windows和Linux的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我需要为win和linux操作系统编写一些库,希望make或

somethink可以帮助我自动化我的构建过程。但是如何在两个操作系统下使用

ONE makefile - 如何在make

脚本中检测操作系统?


有人举个例子吗?

谢谢

Hello,

I need to code some libraries for win and linux os and hope make or
somethink can help me to automate my build process. But how can I use
ONE makefile under both os - how can I detect the os in the make
script?

Has anybody an example?
Thanks

推荐答案

Bastie说:
Bastie said:

您好,


我需要为win和linux操作系统编写一些库代码并希望make或

somethink可以帮助我自动化我的构建过程。但是如何在两个操作系统下使用

ONE makefile - 如何检测make

脚本中的操作系统?
Hello,

I need to code some libraries for win and linux os and hope make or
somethink can help me to automate my build process. But how can I use
ONE makefile under both os - how can I detect the os in the make
script?



你为什么需要?只需轻轻编写代码即可。


-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上述域名中, - www。

Why would you need to? Just write the code portably.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.


On 29 Mrz。,17:09,Richard Heathfield< ; r ... @ see.sig.invalidwrote:
On 29 Mrz., 17:09, Richard Heathfield <r...@see.sig.invalidwrote:

Bastie说:
Bastie said:

你好,
Hello,


我需要为win和linux操作系统编写一些库,希望make或

somethink可以帮助我自动化我的构建处理。但是如何在两个操作系统下使用

ONE makefile - 如何检测make

脚本中的操作系统?
I need to code some libraries for win and linux os and hope make or
somethink can help me to automate my build process. But how can I use
ONE makefile under both os - how can I detect the os in the make
script?



你为什么需要?只需便携式编写代码。


Why would you need to? Just write the code portably.



并非所有代码都如此便携 - 例如,读取目录所需的所有文件的代码

(我想是这样的)赢得winapi ...

Not all code are so portably - for example the code to read all files
in the directory need (i think so) under win the winapi...


Bastie说:
Bastie said:

On 29 Mrz。,17:09,Richard Heathfield< r ... @ see.sig.invalidwrote:
On 29 Mrz., 17:09, Richard Heathfield <r...@see.sig.invalidwrote:

> Bastie说:
>Bastie said:

你好,
Hello,


我需要为win和linux操作系统编写一些库,希望make或者

somethink可以帮助我自动化我的构建过程。但是我怎样才能在两个操作系统下使用一个makefile-如何在

make脚本中检测操作系统?
I need to code some libraries for win and linux os and hope make or
somethink can help me to automate my build process. But how can I
use ONE makefile under both os - how can I detect the os in the
make script?


为什么需要?只需便携式编写代码。


Why would you need to? Just write the code portably.



并非所有代码都如此便携 - 例如,读取目录所需的所有文件的代码

(我想是这样的)赢得winapi ...

Not all code are so portably - for example the code to read all files
in the directory need (i think so) under win the winapi...



简单 - 只需将非便携式位分离成单独的模块,写一下

two具有相同名称的版本(例如dirwalk.c),将其中一个保存在Win32系统上,另一个保存在Linux系统上,另一个保存在你的makefile中,你的makefile

保持不变在两个系统上。不用担心。


-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上述域名中, - www。

Easy - just isolate the non-portable bits into separate modules, write
two versions with the same name (e.g. dirwalk.c), keep one of them on
the Win32 system and the other on the Linux system, and your makefile
stays the same on both systems. No worries.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.


这篇关于Windows和Linux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆