From fdaf37c84b7c7c364d6bb9ed4df134a20ec45d90 Mon Sep 17 00:00:00 2001 From: Piotr Marendowski Date: Sat, 9 Mar 2024 12:43:35 +0100 Subject: [PATCH] Initial stuff --- Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ config.def.h | 0 config.h | 0 ggg.1 | 0 ggg.c | 8 ++++++++ 5 files changed, 49 insertions(+) create mode 100644 Makefile create mode 100644 config.def.h create mode 100644 config.h create mode 100644 ggg.1 create mode 100644 ggg.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..681307b --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +.POSIX: +.SUFFIXES: + +TARGET = ggg +MANPAGE = ggg.1 +SRC = ggg.c + +CONF = config.h +DEFCONF = config.def.h +PREFIX ?= /usr/local + +BINDIR = $(PREFIX)/bin +MANDIR = $(PREFIX)/share/man/man1 + +# Flags +CFLAGS += -O3 -s -std=c99 -W -pedantic -Wall -Wextra -Werror + +.PHONY: all install uninstall clean + +all: $(TARGET) + +$(TARGET): $(CONF) $(SRC) + $(CC) $(CFLAGS) $(LDFLAGS) $(SRC) -o $@ + +$(CONF): + cp -v $(DEFCONF) $(CONF) + +install: $(TARGET) + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(MANDIR) + cp -p $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET) + chmod 755 $(DESTDIR)$(BINDIR)/$(TARGET) + cp -p $(MANPAGE) $(DESTDIR)$(MANDIR)/$(MANPAGE) + chmod 644 $(DESTDIR)$(MANDIR)/$(MANPAGE) + +uninstall: + $(RM) $(DESTDIR)$(BINDIR)/$(TARGET) + $(RM) $(DESTDIR)$(MANDIR)/$(MANPAGE) + +clean: + $(RM) $(TARGET) diff --git a/config.def.h b/config.def.h new file mode 100644 index 0000000..e69de29 diff --git a/config.h b/config.h new file mode 100644 index 0000000..e69de29 diff --git a/ggg.1 b/ggg.1 new file mode 100644 index 0000000..e69de29 diff --git a/ggg.c b/ggg.c new file mode 100644 index 0000000..602651f --- /dev/null +++ b/ggg.c @@ -0,0 +1,8 @@ +#include + +int main(int argc, char** argv) +{ + printf("Hello\n"); + + return 0; +}