Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement windows OS detection and fix apps build #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions Makefile.programs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
ARCH =
ENV =
OSTYPE =
EXTEN =
ifeq ($(shell uname),Darwin)
# This is an Apple OS X computer.
OSTYPE = OSX
Expand All @@ -47,20 +48,22 @@ ifeq ($(shell uname),Darwin)
# if compiling on a 64-bit computer, but you want 32-bit version
# (for linking with other 32-bit libraries).
#ARCH = -m32 -arch i386
else
ifeq ($(shell uname -o),Msys)
# This is probably a windows computer with MinGW toolchain (Msys shell).
OSTYPE = WINDOWS

# MinGW (and Cygwin?) adds the string ".exe" to the end of compiled programs.
# so set EXTEN = .exe when compiling on Windows.
EXTEN = .exe
else
# This is probably a linux computer.
OSTYPE = LINUX

# The ARCH variable has to be set up slightly different for 32-bit compiling:
#ARCH = -m32
endif

# Cygwin (and MinGW?) adds the string ".exe" to the end of compiled programs.
# so set EXTEN = .exe when compiling in cygwin. (Need a test for cygwin
# so that the EXTEN variable is setup automatically...)
EXTEN =
# EXTEN = .exe

endif

##############################
#
Expand Down Expand Up @@ -106,20 +109,23 @@ vpath %.cpp $(SRCDIR)

# generating a list of the programs to compile with "make all"
PROGS1=$(notdir $(patsubst %.cpp,%,$(wildcard $(SRCDIR)/*.cpp)))
ifeq ($(shell uname),Darwin)
ifeq ($(OSTYPE),OSX)
PROGS := $(filter-out midi2beep,$(PROGS1))
else
ifeq ($(OSTYPE),WINDOWS)
PROGS := $(filter-out midi2beep,$(PROGS1))
else
PROGS := $(PROGS1)
endif

endif

##############################
##
## Targets:
##

# targets which don't actually refer to files
.PHONY : all info library examples programs bin options clean
.PHONY : all info library examples programs bin options clean

examples: all
all: bin $(addprefix $(TARGDIR)/,$(PROGS))
Expand Down