]> git.cameronkatri.com Git - snaprestore.git/commitdiff
Use proper Makefile syntax in rules
authorTheRealKeto <therealketo@gmail.com>
Mon, 30 Aug 2021 20:08:28 +0000 (16:08 -0400)
committerCameron Katri <me@cameronkatri.com>
Wed, 1 Sep 2021 15:18:59 +0000 (11:18 -0400)
- Refer to rule requisites using proper syntax for rules
- Declare rules that don't refer to files as phony

Signed-off-by: Cameron Katri <me@cameronkatri.com>
Makefile

index cb49dc13d36703bb0cd205675b7e9e4e6b67c168..ccb9b9cd0c302490ff52d0706ff0d4045c6126dd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,13 +16,13 @@ all: build/snaprestore
 
 build/snaprestore: src/snaprestore.m src/ent.xml
        mkdir -p build
-       $(CC) $(CFLAGS) -o build/snaprestore src/snaprestore.m -framework IOKit -framework Foundation -framework CoreServices -fobjc-arc
-       $(STRIP) build/snaprestore
-       $(LDID) -Ssrc/ent.xml build/snaprestore
+       $(CC) $(CFLAGS) -o $@ $< -framework IOKit -framework Foundation -framework CoreServices -fobjc-arc
+       $(STRIP) $@
+       $(LDID) -S$(word 2,$^) $@
 
-install: build/snaprestore
-       $(INSTALL) -Dm755 build/snaprestore $(DESTDIR)$(PREFIX)/bin/snaprestore
-       $(INSTALL) -Dm644 LICENSE $(DESTDIR)$(PREFIX)/share/snaprestore/LICENSE
+install: build/snaprestore LICENSE
+       $(INSTALL) -Dm755 $< $(DESTDIR)$(PREFIX)/bin/snaprestore
+       $(INSTALL) -Dm644 $(word 2,$^) $(DESTDIR)$(PREFIX)/share/snaprestore/$(word 2,$^)
 
 package: install
        rm -rf staging
@@ -46,3 +46,5 @@ uninstall:
 
 clean:
        rm -f build/snaprestore
+
+.PHONY: all package uninstall clean