Skip to content

Commit

Permalink
Extract cmocka into standard named directory as part of make
Browse files Browse the repository at this point in the history
  • Loading branch information
rhargreaves committed Feb 19, 2025
1 parent bcbeeca commit a21986b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bin/
*.bin
*.o
*.code-workspace
tests/cmocka/
tests/build/
tests/bin/
tests/obj/
out/
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ RUN apt-get -y update && \
unzip && \
git config --global --add safe.directory "*"
WORKDIR /app
COPY tests/cmocka-*.tar.xz /app/tests/
COPY tests/Makefile /app/tests/Makefile
RUN make -C tests cmocka
COPY . /app
EXPOSE 2345
ENTRYPOINT []
6 changes: 3 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SGDK?=/sgdk
BIN_DIR=bin
OBJ_DIR=obj
CMOCKA_TAR=third_party/cmocka-1.1.7.tar.xz
CMOCKA_DIR=cmocka
CMOCKA_DIR=build/deps/cmocka

ifeq ($(DEBUG),1)
GDB=gdbserver :2345
Expand Down Expand Up @@ -233,7 +233,7 @@ system: $(SYSTEM_TESTS_TARGET)
$(GDB) ./$(SYSTEM_TESTS_TARGET)
.PHONY: system

$(OBJ_DIR)/%.o: %.c
$(OBJ_DIR)/%.o: %.c | $(CMOCKA_DIR)
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -MMD -MT "$@ $(basename $@).d" -c $< -o $@

Expand All @@ -258,5 +258,5 @@ clean-target:
.PHONY: clean-target

clean: clean-target
rm -rf $(CMOCKA_DIR)
rm -rf build/
.PHONY: clean

0 comments on commit a21986b

Please sign in to comment.