diff --git a/Makefile b/Makefile index a1f9a0a..0d52301 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,9 @@ # Works on Linux, macOS, and Windows # ============================================================ +# Define target executable (must be defined before config.mk is included) +BIN := luma + # Include default config include config.default.mk @@ -15,8 +18,6 @@ endif # Paths & Files # ------------------------------------------------------------ -BIN := luma - # Detect OS and set appropriate commands ifeq ($(OS),Windows_NT) # Windows commands @@ -152,4 +153,4 @@ help: @echo run-llvm - Run generated bitcode with lli @echo compile-native - Compile LLVM IR to native executable @echo clean - Remove all build artifacts - @echo help - Show this help \ No newline at end of file + @echo help - Show this help diff --git a/config.mk.in b/config.mk.in index ade6a94..bc5018f 100644 --- a/config.mk.in +++ b/config.mk.in @@ -1,4 +1,4 @@ -CC = @CXX@ +CC = @CC@ CFLAGS += @CXXFLAGS@ LDFLAGS += @LDFLAGS@ PREFIX = @prefix@ diff --git a/configure.ac b/configure.ac index b798f13..0de8e85 100644 --- a/configure.ac +++ b/configure.ac @@ -3,9 +3,9 @@ AC_PREREQ([2.69]) AC_CONFIG_SRCDIR([src/main.c]) # sanity check to make sure someone didn't pass a garbage --srcdir #AM_INIT_AUTOMAKE([foreign 1.16 dist-bzip2]) -AC_PROG_CXX -AC_LANG(C++) -AC_SUBST(CXX) +AC_PROG_CC +AC_LANG(C) +AC_SUBST(CC) # connor, i have no idea why you're expecting CC to be a C++ compiler. # that's what CXX is for.