From ee26652f4e6d418434f34ef7a6179ee23f5bf3a9 Mon Sep 17 00:00:00 2001 From: Simon From Jakosen Date: Wed, 7 Aug 2024 10:10:18 +0200 Subject: [PATCH] make yocto compatible --- helloworld-c-make/Makefile | 13 ++----------- helloworld-c-make/README.md | 4 +--- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/helloworld-c-make/Makefile b/helloworld-c-make/Makefile index 5027b45..40f7126 100644 --- a/helloworld-c-make/Makefile +++ b/helloworld-c-make/Makefile @@ -1,13 +1,7 @@ EXECUTABLE = helloworld-c-make -INSTALL_PREFIX = /usr/local - CFLAGS = -std=c17 -Wall -Wextra -pedantic -pedantic-errors -O2 -LFLAGS = - -LD=gcc -CC=gcc SOURCE_FILES = \ src/main.c @@ -18,11 +12,8 @@ HEADER_FILES = $(shell find src/ -name *.h) all: build/$(EXECUTABLE) build/compile_flags.txt -install: build/$(EXECUTABLE) - cp build/$(EXECUTABLE) $(INSTALL_PREFIX)/bin/$(EXECUTABLE) - build/$(EXECUTABLE): $(OBJECT_FILES) - $(LD) -o $@ $(LFLAGS) $^ + $(CC) -o $@ $(LDFLAGS) $^ build/%.o: src/%.c $(HEADER_FILES) build-folder $(CC) -c -o $@ $(CFLAGS) $< @@ -31,7 +22,7 @@ build-folder: mkdir -p build/ clean: - $(RM) build/ + rm -rf build/ build/compile_flags.txt: echo -xc $(CFLAGS) \ diff --git a/helloworld-c-make/README.md b/helloworld-c-make/README.md index 5bdbf81..8939ecf 100644 --- a/helloworld-c-make/README.md +++ b/helloworld-c-make/README.md @@ -9,9 +9,7 @@ make ``` make -sudo make install -# or -sudo make INSTALL_PREFIX=/usr/local install +sudo cp build/helloworld-c-make /usr/local/bin/ helloworld-c-make ```