Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@emptypage
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emptypage/b35bf8e85f2117ea7df3 to your computer and use it in GitHub Desktop.
Save emptypage/b35bf8e85f2117ea7df3 to your computer and use it in GitHub Desktop.
Makefile to build wxWidgets for MS Windows.
# Makefile to build wxWidgets for MS Windows.
!IFDEF WX
INSTALL_DIR = $(WX)
!ELSE IFNDEF INSTALL_DIR
INSTALL_DIR = C:\wxWidgets
!ENDIF
!IFNDEF SRC_DIR
SRC_DIR = wxWidgets
!ENDIF
VER_NAME = 3.0.2
GIT_TAG = v3.0.2
PLATFORMTOOLSET = v$(VISUALSTUDIOVERSION:.=)
BASE_NAME = wxWidgets-$(VER_NAME)
DIST_DIR = $(BASE_NAME)-win32-$(PLATFORMTOOLSET)
SETUP_H = $(SRC_DIR)\include\wx\msw\setup.h
SETUP0_H = $(SRC_DIR)\include\wx\msw\setup0.h
all: build build-utils
checkout:
cd $(SRC_DIR) && git checkout $(GIT_TAG)
dist: build build-utils $(DIST_DIR)
xcopy $(SRC_DIR)\include $(DIST_DIR)\include\ /D /S /Y
xcopy $(SRC_DIR)\lib\vc_lib $(DIST_DIR)\lib\vc_lib\ /D /S /Y
xcopy $(SRC_DIR)\lib\vc_dll $(DIST_DIR)\lib\vc_dll\ /D /S /Y /EXCLUDE:<<
.exp
.ilk
.manifest
<<
xcopy $(SRC_DIR)\utils\wxrc\vc_mswu\wxrc.exe $(DIST_DIR)\bin\ /D /Y
$(DIST_DIR):
-md $@
-md $@\bin
-md $@\include
-md $@\lib
install: dist
xcopy $(DIST_DIR) $(INSTALL_DIR)\ /D /S /Y
archive: $(DIST_DIR).zip
$(DIST_DIR).zip: dist
zip -r -9 $@ $(DIST_DIR)
build: build-static-debug build-static-release build-dll-debug build-dll-release
clean: clean-static-debug clean-static-release clean-dll-debug clean-dll-release
cleanall: clean clean-utils
setup: .gitignore checkout $(SETUP_H)
$(SETUP_H): $(SETUP0_H)
copy $? $@
build-static-debug: setup
cd $(SRC_DIR)\build\msw && $(MAKE) /nologo /f makefile.vc
build-static-release: setup
cd $(SRC_DIR)\build\msw && $(MAKE) /nologo /f makefile.vc BUILD=release
build-dll-debug: setup
cd $(SRC_DIR)\build\msw && $(MAKE) /nologo /f makefile.vc SHARED=1
build-dll-release: setup
cd $(SRC_DIR)\build\msw && $(MAKE) /nologo /f makefile.vc BUILD=release SHARED=1
clean-static-debug:
cd $(SRC_DIR)\build\msw && $(MAKE) /nologo /f makefile.vc clean
clean-static-release:
cd $(SRC_DIR)\build\msw && $(MAKE) /nologo /f makefile.vc BUILD=release clean
clean-dll-debug:
cd $(SRC_DIR)\build\msw && $(MAKE) /nologo /f makefile.vc SHARED=1 clean
clean-dll-release:
cd $(SRC_DIR)\build\msw && $(MAKE) /nologo /f makefile.vc BUILD=release SHARED=1 clean
build-utils: build-static-release
cd $(SRC_DIR)\utils && $(MAKE) /nologo /f makefile.vc BUILD=release
clean-utils:
-cd $(SRC_DIR)\utils && $(MAKE) /nologo /f makefile.vc BUILD=release clean
BANG = !
.gitignore:
copy << $@
*
$(BANG)Makefile
<<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment