diff options
author | Mattias Andrée <maandree@kth.se> | 2021-09-16 16:05:05 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-09-16 16:05:05 +0200 |
commit | 744f1b4d36f1671c03f63820246746a5b52f24be (patch) | |
tree | fc5c86167c63d1771add281ac77a7ad8f588f206 /Makefile | |
parent | Update man page (diff) | |
download | adjbacklight-ae393f80c10e0784dbe9768043b814d89aaba5c9.tar.gz adjbacklight-ae393f80c10e0784dbe9768043b814d89aaba5c9.tar.bz2 adjbacklight-ae393f80c10e0784dbe9768043b814d89aaba5c9.tar.xz |
Improve makefile and fix warnings8.2.1
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 9 insertions, 14 deletions
@@ -3,19 +3,18 @@ CONFIGFILE = config.mk include $(CONFIGFILE) -all: adjbacklight test +BIN = adjbacklight test +OBJ = $(BIN:=.o) -adjbacklight.o: adjbacklight.c arg.h - $(CC) -c -o adjbacklight.o adjbacklight.c $(CCFLAGS) $(CPPFLAGS) -adjbacklight: adjbacklight.o - $(CC) -o adjbacklight adjbacklight.o $(LDFLAGS) +all: adjbacklight test +$(OBJ): arg.h -test.o: test.c adjbacklight.c arg.h - $(CC) -c -o test.o test.c $(CCFLAGS) $(CPPFLAGS) +.c.o: + $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) -test: test.o - $(CC) -o test test.o $(LDFLAGS) +.o: + $(CC) -o $@ $< $(LDFLAGS) check: test ./test.sh @@ -23,10 +22,8 @@ check: test install: adjbacklight mkdir -p -- "$(DESTDIR)$(PREFIX)/bin" mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1" - mkdir -p -- "$(DESTDIR)$(PREFIX)/share/licenses/adjbacklight" cp -- adjbacklight "$(DESTDIR)$(PREFIX)/bin" cp -- adjbacklight.1 "$(DESTDIR)$(MANPREFIX)/man1" - cp -- LICENSE "$(DESTDIR)$(PREFIX)/share/licenses/adjbacklight" post-install: chown -- '0:$(VIDEO_GROUP)' "$(DESTDIR)$(PREFIX)/bin/adjbacklight" @@ -35,10 +32,8 @@ post-install: uninstall: -rm -- "$(DESTDIR)$(PREFIX)/bin/adjbacklight" -rm -- "$(DESTDIR)$(MANPREFIX)/man1/adjbacklight.1" - -rm -- "$(DESTDIR)$(PREFIX)/share/licenses/adjbacklight/LICENSE" - -rmdir -- "$(DESTDIR)$(PREFIX)/share/licenses/adjbacklight" clean: - -rm -rf -- adjbacklight test *.o .testdir + -rm -rf -- adjbacklight test .testdir *.o *.su .PHONY: all check install post-install uninstall clean |