From 9ec67871aebb039de696b2ee531a8759fc6e2e42 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Sat, 22 May 2021 11:15:03 +0000 Subject: makefile: rewrite dummy to complete version --- Makefile | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index bd26c86..65f084f 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,30 @@ CC = gcc CFLAGS = -Wall -g -SOURCES = xstring.c ctimeline.c +SOURCES = xstring.c ui-common.c ctimeline.c OBJECTS = ${SOURCES:.c=.o} -EXECUTABLE = app -all: - @$(CC) $(DEFINES) $(CFLAGS) -c $(SOURCES) - @$(CC) $(DEFINES) $(CFLAGS) -o $(EXECUTABLE) $(OBJECTS) +CTIMELINE_PATH = /var/www/html/ctimeline +CTIMELINE_ELF = ctimeline.cgi +CTIMELINE_CSS = ctimeline.css + +.PHONY: all clean install uninstall + +all: $(CTIMELINE_ELF) + +$(CTIMELINE_ELF): $(OBJECTS) + $(CC) $(CFLAGS) -o $(CTIMELINE_ELF) $(OBJECTS) + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -rf $(CTIMELINE_ELF) $(OBJECTS) + +install: all + install -m 755 -d $(CTIMELINE_PATH) + install -m 755 $(CTIMELINE_ELF) $(CTIMELINE_PATH)/$(CTIMELINE_ELF) + install -m 755 $(CTIMELINE_CSS) $(CTIMELINE_PATH)/$(CTIMELINE_CSS) + +uninstall: + rm -f $(CTIMELINE_PATH)/$(CTIMELINE_ELF) + rm -f $(CTIMELINE_PATH)/$(CTIMELINE_CSS) -- cgit v1.2.3-18-g5258