OS determination by Makefile using Python

There was a request to change the file that starts on Windows and OS X, so I tried to determine the OS with Makefile. By the way, ʻuname` does not work on Windows, so this time I am using ** platform ** of ** Python **.

OSPLATFORM = $(shell python -c 'import platform; print platform.system()') 

Reference 15.15. platform — Refer to the unique information of the running platform http://docs.python.jp/2.7/library/platform.html

kickoff:
ifeq ($(OSPLATFORM),Windows)
    $(KICKOFF_BAT)
else ifeq ($(OSPLATFORM), Darwin)
    $(KICKOFF_SH)
endif

Use it like this.

Recommended Posts

OS determination by Makefile using Python
Platform (OS) determination by Python
Python> dictionary> values ()> Get All Values by Using values ()
[Python] Progress display by progress bar using tqdm
Start using Python
Python OS operation
Scraping using Python
My os (python)
I tried using the Datetime module by Python
Operate Redmine using Python Redmine
Visualization memo by Python
Communication processing by Python
Data cleaning using Python
WiringPi-SPI communication using Python
Age calculation using python
Beamformer response by python
Search Twitter using Python
Speech file recognition by Google Speech API v2 using Python
Name identification using python
Notes using Python subprocesses
Try using Tweepy [Python2.7]
Using multiple versions of Python on Mac OS X (2) Usage
Using NAOqi 2.4.2 Python SDK on Mac OS X El Capitan
Inflating text data by retranslation using google translate in Python
Python notes using perl-ternary operator
Flatten using Python yield from
Scraping using Python 3.5 async / await
Save images using python3 requests
Speech recognition by Python MFCC
[S3] CRUD with S3 using Python [Python]
[Python] Try using Tkinter's canvas
EXE Web API by Python
Newcomer training program by Python
Parameter setting by python configparser
Try using Kubernetes Client -Python-
Pin python managed by conda
Python notes using perl-special variables
[Python] Using OpenCV with Python (Basic)
Scraping using Python 3.5 Async syntax
Post to Twitter using Python
Start to Selenium using python
Search algorithm using word2vec [python]
Change python version using pyenv
python: Basics of using scikit-learn ①
# 1 [python3] Simple calculation using variables
Keyword extraction by MeCab (python)
Create JIRA tickets using Python
Separate numbers by 3 digits (python)
Instrument control using Python [pyvisa]
Manipulate spreadsheets locally using Python
Python memo using perl --join
Markov switching model by Python
Web scraping using Selenium (Python)
[Python] I tried using OpenPose
Image processing by python (Pillow)
Python started by C programmers
[Python] JSON validation using Voluptuous
Broadcast on LINE using python
Data analysis using python pandas
Translate using googletrans in Python
Using Python mode in Processing