Hello world initilized

This commit is contained in:
2024-08-18 23:13:18 +02:00
parent 4e8d0b6f8c
commit dbda7e15b0
3 changed files with 41 additions and 0 deletions

27
src/Makefile Normal file
View File

@@ -0,0 +1,27 @@
OBJECTS = main.o
TARGET = hello
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) -o $@ $^
main.o: | new_header
main.o: version.h
new_header:
@sed -e "s/<version>/$$(git describe)/g" \
<version.h.in> version.h.tmp
@if diff -q version.h.tmp version.h > /dev/null 2>&1; \
then \
rm version.h.tmp; \
else \
echo "version.h.in => version.h" ; \
mv version.h.tmp version.h;\
fi
clean:
rm -f $(TARGET) $(OBJECTS) version.h
.PHONY: all clean