write a makefile and compile it
This commit is contained in:
parent
4b6dd78dbf
commit
90307d2527
2 changed files with 43 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
bin
|
42
Makefile
Normal file
42
Makefile
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
# Makefile for 'Kaiser Operating System (KOS)' (cringe) and my first calculator app
|
||||||
|
# This makefile is not part of the original files.
|
||||||
|
|
||||||
|
# Compiler
|
||||||
|
CXX = g++
|
||||||
|
|
||||||
|
# Compiler flags
|
||||||
|
CXXFLAGS = -Wall -Wextra -std=c++11 -Ifiles
|
||||||
|
|
||||||
|
# Executables
|
||||||
|
CALCULATOR = $(BIN)/calculator
|
||||||
|
KOS = $(BIN)/kos
|
||||||
|
|
||||||
|
# Source files
|
||||||
|
CALCULATOR_SRC = files/calculator.cxx
|
||||||
|
KOS_SRC = files/KOS.cpp
|
||||||
|
|
||||||
|
# Header files
|
||||||
|
HEADERS = files/calculator.h files/KOSFunctions.h files/KOSVariables.h
|
||||||
|
|
||||||
|
BIN = ./bin
|
||||||
|
|
||||||
|
# Default target
|
||||||
|
all: $(CALCULATOR) $(KOS)
|
||||||
|
|
||||||
|
$(BIN):
|
||||||
|
mkdir -p $(BIN)
|
||||||
|
|
||||||
|
# Calculator executable
|
||||||
|
$(CALCULATOR): $(CALCULATOR_SRC) $(HEADERS) $(BIN)
|
||||||
|
$(CXX) $(CXXFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
# KOS executable
|
||||||
|
$(KOS): $(KOS_SRC) $(HEADERS)
|
||||||
|
$(CXX) $(CXXFLAGS) -o $@ $<
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
clean:
|
||||||
|
rm -f $(CALCULATOR) $(KOS)
|
||||||
|
rm -rf $(BIN)
|
||||||
|
|
||||||
|
.PHONY: all clean
|
Loading…
Add table
Reference in a new issue