checkpolicy: pass CFLAGS at link stage

Pass CFLAGS when invoking CC at link time, it might contain optimization
or sanitizer flags required for linking.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
Christian Göttsche 2021-07-06 19:54:21 +02:00 committed by Nicolas Iooss
parent 07d6f1cea5
commit 40e2f98519
No known key found for this signature in database
GPG key ID: C191415F340DAAA0
2 changed files with 4 additions and 4 deletions

View file

@ -30,10 +30,10 @@ all: $(TARGETS)
$(MAKE) -C test
checkpolicy: $(CHECKPOLOBJS) $(LIBSEPOLA)
$(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS_LIBSEPOLA)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS_LIBSEPOLA)
checkmodule: $(CHECKMODOBJS) $(LIBSEPOLA)
$(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS_LIBSEPOLA)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS_LIBSEPOLA)
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<

View file

@ -13,10 +13,10 @@ endif
all: dispol dismod
dispol: dispol.o $(LIBSEPOLA)
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA)
dismod: dismod.o $(LIBSEPOLA)
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS_LIBSEPOLA)
clean:
-rm -f dispol dismod *.o