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

AGEPRO makefile #8

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

AGEPRO makefile #8

wants to merge 4 commits into from

Conversation

efletcherPIFSC
Copy link
Collaborator

@efletcherPIFSC efletcherPIFSC commented Nov 1, 2023

Makefile for AGEPRO. Built using MSYS2-mingw (ucrt64). (windows)

Note: Visual Studio Code's terminals had issues with cleaning object files, this is due to windows powershell with no native command for rm. Using MSYS2-mingw or "git bash" fixes this.

This following assumes that the system and user environmental PATH variable is set to C:\\msys64\\ucrt64\\bin\\. To check if it is configured properly, open command prompt and type gcc --version or mingw32-make --version.

Build AGERPRO with Makefile on AGEPRO Project root directory:

$ mingw32-make all -f makefile
gcc  -c -o obj/ranx.o src/ranx.c
gcc  -c -o obj/boxmuller.o src/boxmuller.c
gcc  -c -o obj/util.o src/util.c
[Info] Building Binary Executable [AGEPRO.exe]
gcc  -o ./bin/AGEPRO.exe obj/ranx.o obj/boxmuller.o obj/util.o ./src/AgePro.c

Clean up Object Files

$ mingw32-make clean -f makefile
echo "[Clean] Clean Object Files"
[Clean] Clean Object Files
rm -f ./obj/ranx.o ./obj/boxmuller.o ./obj/util.o

@efletcherPIFSC
Copy link
Collaborator Author

@JonBrodziak There are 2 issues using the makefile in the Linux/Unbuntu enviroment:

  1. Included library <math.h> requires an -lm option (commit 47535d2 )

  2. The makefile warnings flags were disabled (commented off), but Ubuntu's compiler toolchain uses warning flags -Wformat and -Wformat-security by default (https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-Wformat_-Wformat-security), Adding in -Wformat=0 to makefile's C_FLAGS disables the default flag.

However, instead of disabling warning flags, I am inclined to enable warning flags (-Wall -Wextra) to the makefile. Enabling the warning flags on the makefile spotted issues #9, #10.

@JonBrodziak
Copy link
Collaborator

This makefile appears to require "MSYS2-mingw (ucrt64). (windows)".
This may limit the general application. Can this makefile be revised to
work with any C language compiler system? Thanks.

@efletcherPIFSC
Copy link
Collaborator Author

@JonBrodziak I think pivoting to the CMAKE-ninja build toolset will be a better direction than make

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants