Skip to content

Commit

Permalink
Remove Make.inc and simplify build
Browse files Browse the repository at this point in the history
  • Loading branch information
Viral B. Shah committed Aug 9, 2024
1 parent 739a202 commit 05decfb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 62 deletions.
55 changes: 0 additions & 55 deletions Make.inc

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ clean:
rm -rf R-*

R-$(RVERSION).tar.gz:
wget https://cran.r-project.org/src/base/R-4/$@
curl -L -O https://cran.r-project.org/src/base/R-4/$@

update: R-$(RVERSION).tar.gz
tar -xzvf $< --strip-components 3 -C src --include '*/src/nmath/*.[ch]' \
Expand Down
35 changes: 29 additions & 6 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
include ../Make.inc
# -*- mode: makefile -*-

# Default value, can be overriden on the command line
# or with an environment variable.
CC ?= gcc

OS = $(shell uname)

ifneq (,$(findstring MINGW,$(OS)))
override OS := Windows_NT
endif
ifneq (,$(findstring MSYS,$(OS)))
override OS := Windows_NT
endif
ifneq (,$(findstring CYGWIN,$(OS)))
override OS := Windows_NT
endif

ifeq ($(OS), Darwin)
SHLIB_EXT = dylib
else ifeq ($(OS), Windows_NT)
SHLIB_EXT = dll
else
SHLIB_EXT = so
endif

SRCS = $(wildcard *.c)
OBJS = $(SRCS:%.c=%.o)
Expand All @@ -10,21 +34,20 @@ else
XOBJS = $(DOBJS)
endif

CFLAGS-add += -DMATHLIB_STANDALONE

CFLAGS += -DMATHLIB_STANDALONE -fPIC -O3 -std=c99 -I../include

default: release

%.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS-add) $(CFLAGS) $(fPIC) -std=gnu99 -I../include -DNDEBUG -c $< -o $@
$(CC) $(CPPFLAGS) $(CFLAGS) -DNDEBUG -c $< -o $@
%.do: %.c
$(CC) $(CPPFLAGS) $(CFLAGS-add) $(CFLAGS) $(fPIC) -std=gnu99 -I../include -g -c $< -o $@
$(CC) $(CPPFLAGS) $(CFLAGS) -g -c $< -o $@

release debug: libRmath-julia.$(SHLIB_EXT)

libRmath-julia.$(SHLIB_EXT): $(XOBJS)
-rm -f $@
$(CC) $(LDFLAGS-add) $(LDFLAGS) -shared -o $@ $^
$(CC) $(LDFLAGS) -shared -o $@ $^

clean:
-rm -f *.o *.do *.a *.$(SHLIB_EXT) core* *~ *#

0 comments on commit 05decfb

Please sign in to comment.