Skip to content

Commit

Permalink
build: correct some targets and their rules to prevent unneeded rebuilds
Browse files Browse the repository at this point in the history
Without this patch the binaries are linked anew and the manpage gets
recreated with every 'make' and 'make install' call, even if no changes
to the sources have happened.
  • Loading branch information
Sven Geuer authored and streambinder committed Feb 23, 2024
1 parent 64468ff commit 401cf45
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,22 @@ ifneq (,$(findstring Apple,$(shell $(CC) --version)))
CFLAGS += -fstrict-aliasing -freorder-blocks -fsched-interblock
endif

all: $(BUILDDIR) $(BINS) vpnc.8
all: $(BUILDDIR) $(addprefix $(BUILDDIR)/,$(BINS)) src/vpnc.8

$(BUILDDIR):
@mkdir $@

vpnc: $(OBJS) src/vpnc.o
$(CC) $(LDFLAGS) -o $(BUILDDIR)/$@ $^ $(LIBS)
$(BUILDDIR)/vpnc: $(OBJS) src/vpnc.o
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)

vpnc.8: src/vpnc.8.template src/makeman.pl vpnc
src/vpnc.8: src/vpnc.8.template src/makeman.pl $(VPNC)
./src/makeman.pl $(VPNC)

cisco-decrypt: src/cisco-decrypt.o src/decrypt-utils.o
$(CC) $(LDFLAGS) -o $(BUILDDIR)/$@ $^ $(LIBS)
$(BUILDDIR)/cisco-decrypt: src/cisco-decrypt.o src/decrypt-utils.o
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)

test-crypto: src/sysdep.o src/test-crypto.o src/crypto.o $(CRYPTO_OBJS)
$(CC) $(LDFLAGS) -o $(BUILDDIR)/$@ $^ $(LIBS)
$(BUILDDIR)/test-crypto: src/sysdep.o src/test-crypto.o src/crypto.o $(CRYPTO_OBJS)
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)

.depend: $(SRCS) $(BINSRCS)
$(CC) -MM $(SRCS) $(BINSRCS) $(CFLAGS) $(CPPFLAGS) > $@
Expand Down

0 comments on commit 401cf45

Please sign in to comment.