aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-05-22 11:15:03 +0000
committerJoursoir <chat@joursoir.net>2021-05-22 11:15:03 +0000
commit9ec67871aebb039de696b2ee531a8759fc6e2e42 (patch)
tree43630ed025a6089aaa67a8af8498beaa509a8122 /Makefile
parent462e43c26a4cfdb4204eb37d1040217fa2475b36 (diff)
downloadctimeline-9ec67871aebb039de696b2ee531a8759fc6e2e42.tar.gz
ctimeline-9ec67871aebb039de696b2ee531a8759fc6e2e42.tar.bz2
ctimeline-9ec67871aebb039de696b2ee531a8759fc6e2e42.zip
makefile: rewrite dummy to complete version
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 26 insertions, 5 deletions
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)