Last active
December 5, 2018 09:38
-
-
Save tomdaley92/7d9aafa11255a0b14a2ac2d0d736be1b to your computer and use it in GitHub Desktop.
Build template for Windows C/C++ programs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Thomas Daley | |
# Date: September 16, 2016 | |
# Purpose: Build template for Windows C/C++ Programs. | |
# | |
# Note: Microsoft Visual C/C++ Build Tools are assumed to be installed and | |
# added to PATH. The folders "src" and "bin" are expected. | |
# | |
# 1) vcvarsall | |
# 2) nmake | |
APPNAME = app | |
CONSOLE_APP = /SUBSYSTEM:CONSOLE | |
GUI_APP = /SUBSYSTEM:WINDOWS | |
CC = CL | |
CFLAGS = | |
LFLAGS = /link \ | |
/ENTRY:mainCRTStartup | |
INCS = | |
LIBS = | |
# Default target | |
build: objects | |
$(CC) $(CFLAGS) /Fe$(APPNAME) $(INCS) *.obj $(LIBS) $(LFLAGS) $(CONSOLE_APP) | |
DEL *.obj | |
MOVE $(APPNAME).exe bin/$(APPNAME).exe | |
objects: src/*.c* | |
$(CC) $(CFLAGS) /c $(INCS) $(CFLAGS) $? | |
# Deletes any leftover executables or object files | |
clean: | |
DEL $(APPNAME).exe *.obj | |
cd bin & DEL $(APPNAME).exe |
Author
tomdaley92
commented
Nov 12, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment