commit 0ed024dbcc6dc446bff167a2c718946871ba4748
parent 66476749c57cea2381193c4980c957d2fb0c735c
Author: Nihal Jere <nihal@nihaljere.xyz>
Date: Thu, 7 Oct 2021 17:30:55 -0500
Makefile: define NPM_CORE only when necessary
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
@@ -7,8 +7,6 @@ OBJ = $(SRC:%.c=%.o)
EXE = npm-agent npm-core npmc
NPM_CORE = "npm-core"
-CFLAGS = '-DNPM_CORE=$(NPM_CORE)'
-
all: npm-core npm-agent npmc
npm-core: $(LIBS) npm-core.o monocypher.o
@@ -20,8 +18,8 @@ npm-agent: npm-agent.o
npmc: npmc.o
$(CC) -static npmc.o -o $@
-.c.o:
- $(CC) $(CFLAGS) -c $< -o $@
+npm-agent.o: npm-agent.c
+ $(CC) '-DNPM_CORE=$(NPM_CORE)' $(CFLAGS) -c $< -o $@
install:
install -Dm755 -t $(DESTDIR)$(PREFIX)/bin npm npm-core npmc npm-agent