Skip to content

Commit

Permalink
Add NETZHAUT_PATH to Makefile.
Browse files Browse the repository at this point in the history
Increments-minor-version-of: misc
  • Loading branch information
dajofrey committed Jan 30, 2024
1 parent a89bca7 commit e4306ed
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
20 changes: 13 additions & 7 deletions build/automation/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Defaults
NETZHAUT_PATH ?= $(CURDIR)/external/Netzhaut

# Define the compiler and compile flags
CC = gcc
CFLAGS = -fPIC -std=gnu99 -Wl,-rpath,$(CURDIR)/lib,-rpath,$(CURDIR)/external/Netzhaut/lib
CFLAGS = -fPIC -std=gnu99 -Wl,-rpath,$(CURDIR)/lib,-rpath,$(NETZHAUT_PATH)/lib

# Define the linker and linker flags
LD = gcc
LDFLAGS_TTYR_TTY = -lutil -Lexternal/st-0.8.5/ -l:libst.so
LDFLAGS_TTYR_TERMINAL =
LDFLAGS_TTYR = -Llib -lttyr-api -Lexternal/Netzhaut/lib -lnhapi
LDFLAGS_TTYR = -Llib -lttyr-api -L$(NETZHAUT_PATH)/lib -lnhapi

# Define the source file directory for each library
SRC_DIR_TTYR_TTY = src/lib/ttyr-tty
Expand Down Expand Up @@ -88,7 +91,10 @@ LIB_ST = external/st-0.8.5/libst.so
BIN_TTYR = bin/ttyr

build_netzhaut:
ifeq ($(NETZHAUT_PATH),$(CURDIR)/external/Netzhaut)
(cd external/Netzhaut && git submodule update --init --recursive && make -f build/automation/Makefile nhapi.so nhcore.so nhencoding.so nhwsi.so nhgfx.so)
endif

create_lib_dir:
mkdir -p lib
create_bin_dir:
Expand All @@ -100,10 +106,10 @@ lib: build_netzhaut $(LIB_ST) $(LIB_TTYR_TTY) $(LIB_TTYR_TERMINAL) $(LIB_TTYR_AP
bin: build_netzhaut $(BIN_TTYR)

# Custom compiler flags
$(OBJ_FILES_TTYR_TERMINAL): CFLAGS += -Iexternal/Netzhaut/external -Iexternal/Netzhaut/src/lib -Iexternal/Netzhaut/external/Vulkan-Headers/include -DINCLUDE_VOLK -DVK_VERSION_1_2 -DVK_USE_PLATFORM_XLIB_KHR -DVK_KHR_xlib_surface
$(OBJ_FILES_TTYR_TTY): CFLAGS += -Iexternal/Netzhaut/external -Iexternal/Netzhaut/src/lib
$(OBJ_FILES_TTYR_API): CFLAGS += -Iexternal/Netzhaut/external -Iexternal/Netzhaut/src/lib
$(OBJ_FILES_TTYR): CFLAGS += -Iexternal -Iexternal/Netzhaut/src/lib -Isrc/lib
$(OBJ_FILES_TTYR_TERMINAL): CFLAGS += -I$(NETZHAUT_PATH)/external -I$(NETZHAUT_PATH)/src/lib -I$(NETZHAUT_PATH)/external/Vulkan-Headers/include -DINCLUDE_VOLK -DVK_VERSION_1_2 -DVK_USE_PLATFORM_XLIB_KHR -DVK_KHR_xlib_surface
$(OBJ_FILES_TTYR_TTY): CFLAGS += -I$(NETZHAUT_PATH)/external -I$(NETZHAUT_PATH)/src/lib
$(OBJ_FILES_TTYR_API): CFLAGS += -I$(NETZHAUT_PATH)/external -I$(NETZHAUT_PATH)/src/lib
$(OBJ_FILES_TTYR): CFLAGS += -Iexternal -I$(NETZHAUT_PATH)/src/lib -Isrc/lib

# Rule to compile source files into object files
%.o: $(SRC_DIR_TTYR_TTY)/%.c
Expand Down Expand Up @@ -142,7 +148,7 @@ clean:
rm -f $(OBJ_FILES_TTYR_API) $(LIB_TTYR_API)
rm -f $(OBJ_FILES_ST) $(LIB_ST)
rm -f $(OBJ_FILES_TTYR) $(BIN_TTYR)
rm -rf bin
rm -rf bin lib
(cd external/Netzhaut && make -f build/automation/Makefile clean)

.PHONY: all lib bin clean
10 changes: 5 additions & 5 deletions scripts/prepare-commit-msg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Declare an empty array
files_to_process=()
other="false"
misc="false"

# Run 'git diff --staged --name-only' and process each line
while IFS= read -r line; do
Expand All @@ -11,7 +11,7 @@ while IFS= read -r line; do
# Add the line to the array
files_to_process+=("$line")
else
other="true"
misc="true"
fi
done < <(git diff --staged --name-only)

Expand Down Expand Up @@ -75,8 +75,8 @@ for unique_file in "${unique_files[@]}"; do
done
done

if [[ "$other" = true ]]; then
echo -e "\nWorkload in: other"
if [[ "$misc" = true ]]; then
echo -e "\nWorkload in: misc"
echo "Workload scope options:"
for option in "${workload_options[@]}"; do
echo "$option"
Expand All @@ -93,7 +93,7 @@ if [[ "$other" = true ]]; then
4) workload_scope="api" ;;
esac
echo "Selected workload scope: $workload_scope"
actions+=("Increments-${workload_scope}-version-of: other")
actions+=("Increments-${workload_scope}-version-of: misc")
break
;;
*)
Expand Down

0 comments on commit e4306ed

Please sign in to comment.