From ddf3cce924b5fb1fb9e1703ea5635d2eebf50361 Mon Sep 17 00:00:00 2001 From: Eric Fletcher <37851243+efletcherPIFSC@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:05:31 -1000 Subject: [PATCH 1/4] .gitignore vscode settings --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 9b721a6..ad7bacc 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Visual Studio Code IDE settings +*.vscode \ No newline at end of file From 5795a21fe29fb08a89cb8c7ef9082e068c9fe726 Mon Sep 17 00:00:00 2001 From: efletcherPIFSC <37851243+efletcherPIFSC@users.noreply.github.com> Date: Wed, 1 Nov 2023 11:35:45 -1000 Subject: [PATCH 2/4] added makefile --- makefile | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 makefile diff --git a/makefile b/makefile new file mode 100644 index 0000000..21953e8 --- /dev/null +++ b/makefile @@ -0,0 +1,45 @@ +# Compiler Options +# Enable -Wall -Wextra for GCC compiler warning messages +C_FLAGS := # -Wall -Wextra +CC := gcc + +# Directories the makefile should search +VPATH := ./obj/ ./src/ ./bin/ + +#TARGET binary executable +TARGET := AGEPRO.exe + +# Directory Variables +SRC_DIR := ./src +BIN_DIR := ./bin +OBJ_DIR := ./obj +EXE_PATH := $(BIN_DIR)/$(TARGET) + +# Source Files +# Header files included in src directory +C_FILES := ranx.c boxmuller.c util.c +SRC_FILES := $(C_FILES:%.c=$(SRC_DIR)/%.c) +MAIN_FILE := $(SRC_DIR)/AgePro.c + +# Object Files +OBJ_FILES := $(C_FILES:%.c=$(OBJ_DIR)/%.o) + +# Build +all: $(OBJ_DIR) agepro +.PHONY: all + +#Compile Object Files for non-main source code files +$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c + $(CC) $(C_FLAGS) -c -o $@ $< + +#Compile main file, and link object files to target executable. +agepro: $(OBJ_FILES) + @echo "[Info] Building Binary Executable [$(TARGET)]" + $(CC) $(C_FLAGS) -o $(EXE_PATH) $^ $(MAIN_FILE) + +# Cleanup +PHONY: .clean +clean: + echo "[Clean] Clean Object Files" + -rm -f $(OBJ_FILES) + From 7f8fa6e5f5cac5f0c0447e6c3d78022f21dbdd00 Mon Sep 17 00:00:00 2001 From: Eric Fletcher <37851243+efletcherPIFSC@users.noreply.github.com> Date: Wed, 1 Nov 2023 14:33:59 -1000 Subject: [PATCH 3/4] Fixed typos in makefile cleanup code --- makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile b/makefile index 21953e8..5f6b601 100644 --- a/makefile +++ b/makefile @@ -38,7 +38,7 @@ agepro: $(OBJ_FILES) $(CC) $(C_FLAGS) -o $(EXE_PATH) $^ $(MAIN_FILE) # Cleanup -PHONY: .clean +.PHONY: clean clean: echo "[Clean] Clean Object Files" -rm -f $(OBJ_FILES) From 47535d2cf82d45aa95088252765b4dc1aa07700a Mon Sep 17 00:00:00 2001 From: Eric Fletcher <37851243+efletcherPIFSC@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:00:43 -1000 Subject: [PATCH 4/4] Include '-lm' option to comiple w/ math.h library --- makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 5f6b601..8f29456 100644 --- a/makefile +++ b/makefile @@ -3,6 +3,9 @@ C_FLAGS := # -Wall -Wextra CC := gcc +# Include library to compilation +LIBS := -lm + # Directories the makefile should search VPATH := ./obj/ ./src/ ./bin/ @@ -35,7 +38,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.c #Compile main file, and link object files to target executable. agepro: $(OBJ_FILES) @echo "[Info] Building Binary Executable [$(TARGET)]" - $(CC) $(C_FLAGS) -o $(EXE_PATH) $^ $(MAIN_FILE) + $(CC) $(C_FLAGS) -o $(EXE_PATH) $^ $(MAIN_FILE) $(LIBS) # Cleanup .PHONY: clean