Initial stuff

This commit is contained in:
Piotr Marendowski 2024-03-09 12:43:35 +01:00
parent 562708785c
commit fdaf37c84b
5 changed files with 49 additions and 0 deletions

41
Makefile Normal file
View file

@ -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)

0
config.def.h Normal file
View file

0
config.h Normal file
View file

0
ggg.1 Normal file
View file

8
ggg.c Normal file
View file

@ -0,0 +1,8 @@
#include <stdio.h>
int main(int argc, char** argv)
{
printf("Hello\n");
return 0;
}