diff options
author | Mattias Andrée <maandree@kth.se> | 2021-09-16 17:48:51 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-09-16 17:48:51 +0200 |
commit | e60c82dbb225e90ce8587630a262e4cf1b96c923 (patch) | |
tree | e8a263b59fec228aaa779291ec4b0ed798c2ec31 | |
parent | makefile: add install and uninstall (diff) | |
download | learn-your-telephone-number-e60c82dbb225e90ce8587630a262e4cf1b96c923.tar.gz learn-your-telephone-number-e60c82dbb225e90ce8587630a262e4cf1b96c923.tar.bz2 learn-your-telephone-number-e60c82dbb225e90ce8587630a262e4cf1b96c923.tar.xz |
Improve makefile1.0.1
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | Makefile | 13 | ||||
-rw-r--r-- | config.mk | 6 |
2 files changed, 11 insertions, 8 deletions
@@ -3,26 +3,27 @@ CONFIGFILE = config.mk include $(CONFIGFILE) + all: learn-your-telephone-number -learn-your-telephone-number: learn-your-telephone-number.o - $(CC) -o $@ $@.o $(LDFLAGS) +.c.o: + $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) + +.o: + $(CC) -o $@ $< $(LDFLAGS) install: learn-your-telephone-number mkdir -p -- "$(DESTDIR)$(PREFIX)/bin/" mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1/" - mkdir -p -- "$(DESTDIR)$(PREFIX)/share/licenses/learn-your-telephone-number/" cp -- learn-your-telephone-number "$(DESTDIR)$(PREFIX)/bin/" cp -- learn-your-telephone-number.1 "$(DESTDIR)$(MANPREFIX)/man1/" - cp -- LICENSE "$(DESTDIR)$(PREFIX)/share/licenses/learn-your-telephone-number/" uninstall: -rm -f -- "$(DESTDIR)$(PREFIX)/bin/learn-your-telephone-number" -rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/learn-your-telephone-number.1" - -rm -rf -- "$(DESTDIR)$(PREFIX)/share/licenses/learn-your-telephone-number/" clean: - -rm -f -- learn-your-telephone-number *.o + -rm -f -- learn-your-telephone-number *.o *.su .SUFFIXES: .SUFFIXES: .o .c @@ -1,6 +1,8 @@ -PREFIX = /usr/local +PREFIX = /usr MANPREFIX = $(PREFIX)/share/man +CC = cc + CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -CPFLAGS = -std=c99 -Wall -Wextra -O2 $(CPPFLAGS) +CFLAGS = -std=c99 -Wall -O2 LDFLAGS = -s |