removed old Makefile; just use build.sh or build.bat
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 5 Jan 2021 02:16:44 +0000 (20:16 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 5 Jan 2021 02:16:44 +0000 (20:16 -0600)
.github/workflows/onyx-build.yml
Makefile [deleted file]
bin/onyx
build.sh

index 7d197358754ff8c4bb09a9e985bbccb8822eee64..9f35b6927cff25902cd79fc92dcb0d6abef31375 100644 (file)
@@ -13,9 +13,7 @@ jobs:
 
     steps:
     - uses: actions/checkout@v2
-    - name: add build folder
-      run: mkdir build
-    - name: make
-      run: make
+    - name: build onyx
+      run: ./build.sh
     - name: run tests
       run: ./bin/test
diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index 59c1bd3..0000000
--- a/Makefile
+++ /dev/null
@@ -1,67 +0,0 @@
-RELEASE=1
-USE_GCC=1
-
-OBJ_FILES=\
-       build/onyxlex.o \
-       build/onyxparser.o \
-       build/onyxclone.o \
-       build/onyxtypes.o \
-       build/onyxbuiltins.o \
-       build/onyxentities.o \
-       build/onyxsempass.o \
-       build/onyxsymres.o \
-       build/onyxchecker.o \
-       build/onyxerrors.o \
-       build/onyxutils.o \
-       build/onyxwasm.o \
-       build/onyxdoc.o \
-       build/onyx.o
-
-ifeq (, $(shell which tcc))
-       CC=gcc
-else
-ifeq ($(RELEASE), 0)
-       CC=gcc
-else
-       ifeq ($(USE_GCC),1)
-               CC=gcc
-       else
-               CC=tcc
-       endif
-endif
-endif
-
-INCLUDES=-I./include
-LIBS=
-TARGET=./bin/onyx
-
-# These aren't working yet
-INSTALL_FOLDER=/usr/share/onyx
-DEFINES=-DCORE_INSTALLATION=$(INSTALL_FOLDER)
-
-ifeq ($(RELEASE), 1)
-       FLAGS=-O3
-else
-       FLAGS=-g3
-endif
-
-build/%.o: src/%.c include/bh.h
-       $(CC) $(TIMEFLAG) $(FLAGS) -c $< -o $@ $(INCLUDES)
-
-$(TARGET): $(OBJ_FILES)
-       $(CC) $(TIMEFLAG) $(FLAGS) $(OBJ_FILES) -o $@ $(LIBS)
-
-install: $(TARGET) core/*
-       cp $(TARGET) /usr/bin/
-       cp -r core/ $(INSTALL_FOLDER)/
-
-install_syntax: misc/onyx.vim misc/onyx.sublime-syntax
-       cp ./misc/onyx_compiler.vim /usr/share/vim/vim82/compiler/onyx.vim
-       cp ./misc/onyx.vim /usr/share/vim/vim82/syntax/onyx.vim
-       cp ./misc/onyx.sublime-syntax /home/brendan/.config/sublime-text-3/Packages/User/onyx.sublime-syntax
-       cp ./misc/onyx.sublime-build /home/brendan/.config/sublime-text-3/Packages/User/Onyx.sublime-build
-
-clean:
-       rm -f $(OBJ_FILES) 2>&1 >/dev/null
-
-all: onyx
index 1d3b6254183d744354c322c5e25f5834e6d6ccaa..ad7094dfff6d61f82941dfa99f5ad9b77b508609 100755 (executable)
Binary files a/bin/onyx and b/bin/onyx differ
index bbde6c6daedb88f303eb6068c5e68fdfb227a171..4a5dbed9078636e574ce4757f673ab705d741bd6 100644 (file)
--- a/build.sh
+++ b/build.sh
@@ -7,22 +7,24 @@ CC='gcc'
 WARNINGS='-Wimplicit -Wmisleading-indentation -Wmultistatement-macros -Wparentheses -Wsequence-point -Wreturn-type -Wshift-negative-value -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function -Wunused-label -Wmaybe-uninitialized -Wsign-compare -Wstrict-overflow -Wduplicated-branches -Wduplicated-cond -Wtrigraphs -Waddress -Wlogical-op'
 
 if [ "$1" = "debug" ]; then
-    FLAGS='-g3 -I./include'
+    FLAGS="$WARNINGS -g3 -I./include"
 else
     FLAGS="$WARNINGS -O3 -I./include"
 fi
 
-BUILD_DIR='./build'
+BUILD_DIR='.'
 mkdir -p "$BUILD_DIR"
 
 for file in $C_FILES ; do
     echo "Compiling $file.c"
-    $CC -o build/$file.o $FLAGS -c src/$file.c
+    $CC -o $BUILD_DIR/$file.o $FLAGS -c src/$file.c
 done
 
-ALL_FILES="$(for file in $C_FILES ; do printf "$BUILD_DIR/%s.o " $file ; done)"
 echo "Linking $TARGET"
-$CC -o $TARGET $FLAGS $ALL_FILES
+$CC -o $TARGET $FLAGS $(for file in $C_FILES ; do printf "$BUILD_DIR/%s.o " $file ; done)
+
+echo "Removing object files"
+for file in $C_FILES ; do rm -f "$BUILD_DIR/$file".o 2>/dev/null ; done
 
 echo "Installing onyx executable"
 BIN_DIR='/usr/bin'
@@ -33,6 +35,5 @@ CORE_DIR='/usr/share/onyx'
 sudo mkdir -p "$CORE_DIR"
 sudo cp -r ./core/ "$CORE_DIR"
 
-
 # Otherwise the prompt ends on the same line
 printf "\n"
\ No newline at end of file