From 1020437aade5148be2455fcbd0353ef34dfa7bb8 Mon Sep 17 00:00:00 2001 From: Gregory Werbin Date: Wed, 7 Sep 2022 19:11:35 -0400 Subject: [PATCH] Use CPPFLAGS when needed --- support/c/Makefile | 10 ++++------ support/refc/Makefile | 7 +++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/support/c/Makefile b/support/c/Makefile index 9dd1e494c..8c981b641 100644 --- a/support/c/Makefile +++ b/support/c/Makefile @@ -21,10 +21,10 @@ endif endif +.PHONY: all all: build .PHONY: build - build: $(LIBTARGET) $(DYLIBTARGET) $(LIBTARGET): $(OBJS) @@ -32,26 +32,24 @@ $(LIBTARGET): $(OBJS) $(RANLIB) $@ $(DYLIBTARGET): $(OBJS) - $(CC) -shared -o $@ $^ $(LDFLAGS) - + $(CC) $(CFLAGS) $(CPPFLAGS) -shared -o $@ $^ $(LDFLAGS) -include $(DEPS) %.d: %.c - @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ + @$(CPP) $(CPPFLAGS) $< -MM -MT $(@:.d=.o) >$@ .PHONY: clean - clean: $(RM) $(OBJS) $(DYLIBTARGET) $(LIBTARGET) +.PHONY: cleandep cleandep: clean $(RM) $(DEPS) .PHONY: install - install: build mkdir -p ${PREFIX}/idris2-${IDRIS2_VERSION}/lib mkdir -p ${PREFIX}/idris2-${IDRIS2_VERSION}/support/c diff --git a/support/refc/Makefile b/support/refc/Makefile index 39dfce6aa..d204c3ad0 100644 --- a/support/refc/Makefile +++ b/support/refc/Makefile @@ -15,10 +15,10 @@ ifeq ($(OLD_WIN), 1) endif +.PHONY: all all: build .PHONY: build - build: $(LIBTARGET) $(LIBTARGET): $(OBJS) @@ -28,20 +28,19 @@ $(LIBTARGET): $(OBJS) -include $(DEPS) %.d: %.c - @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ + @$(CPP) $(CPPFLAGS) $< -MM -MT $(@:.d=.o) >$@ $(LDFLAGS) .PHONY: clean - clean: $(RM) $(OBJS) $(LIBTARGET) +.PHONY: cleandep cleandep: clean $(RM) $(DEPS) .PHONY: install - install: build mkdir -p ${PREFIX}/idris2-${IDRIS2_VERSION}/support/refc install -m 644 $(LIBTARGET) *.h ${PREFIX}/idris2-${IDRIS2_VERSION}/support/refc