aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-02-27 13:13:55 +0100
committerMattias Andrée <maandree@kth.se>2021-02-27 13:13:55 +0100
commit5635aa0fe22734cd4330eb4aa330b60d2e1b109f (patch)
tree052e01320739979db583978f48223c594e9ca548 /Makefile
parentm (diff)
downloadgpp-5635aa0fe22734cd4330eb4aa330b60d2e1b109f.tar.gz
gpp-5635aa0fe22734cd4330eb4aa330b60d2e1b109f.tar.bz2
gpp-5635aa0fe22734cd4330eb4aa330b60d2e1b109f.tar.xz
Remove -e flag, remove long options, start rewriting in C, add support for changing shell
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--Makefile33
1 files changed, 17 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index f841829..dae30f0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,31 +1,32 @@
-VERSION = 1.5
+.POSIX:
-PREFIX = /usr
-MANPREFIX = $(PREFIX)/share/man
-
-PKGNAME = gpp
-COMMAND = gpp
-
-PY = python
-SHEBANG = /usr/bin/env $(PY)
+CONFIGFILE = config.mk
+include $(CONFIGFILE)
all: gpp
+gpp.o: gpp.c arg.h
-gpp: gpp.py
- env SHEBANG='$(SHEBANG)' $(PY) gpp.py < gpp.py > $@
+gpp: gpp.o
+ $(CC) -o $@ gpp.o $(LDFLAGS)
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
install: gpp
install -dm755 -- "$(DESTDIR)$(PREFIX)/bin"
- install -m755 -- gpp "$(DESTDIR)$(PREFIX)/bin/$(COMMAND)"
+ install -m755 -- gpp "$(DESTDIR)$(PREFIX)/bin/gpp"
install -dm755 -- "$(DESTDIR)$(MANPREFIX)/man"
- install -m644 -- gpp.1 "$(DESTDIR)$(MANPREFIX)/man/$(COMMAND).1"
+ install -m644 -- gpp.1 "$(DESTDIR)$(MANPREFIX)/man/gpp.1"
uninstall:
- -rm -- "$(DESTDIR)$(PREFIX)/bin/$(COMMAND)"
- -rm -- "$(DESTDIR)$(MANPREFIX)/man/$(COMMAND).1"
+ -rm -- "$(DESTDIR)$(PREFIX)/bin/gpp"
+ -rm -- "$(DESTDIR)$(MANPREFIX)/man/gpp.1"
clean:
- -rm -rf -- gpp bin obj
+ -rm -rf -- gpp *.o *.su
+
+.SUFFIXES:
+.SUFFIXES: .o .c
.PHONY: all install uninstall clean