Use CPPFLAGS when needed

This commit is contained in:
Gregory Werbin 2022-09-07 19:11:35 -04:00 committed by CodingCellist
parent 25388ecac2
commit 1020437aad
2 changed files with 7 additions and 10 deletions

View File

@ -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

View File

@ -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