Skip to content

Commit

Permalink
Added Makefile for Windows (10)
Browse files Browse the repository at this point in the history
  • Loading branch information
chgeuer committed Sep 17, 2018
1 parent 6788458 commit c1458c4
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions Makefile.win
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
!IF [where /Q Makefile.auto.win]
# The file doesn't exist, so don't include it.
!ELSE
!INCLUDE Makefile.auto.win
!IF [del /Q /F Makefile.auto.win] == 0
!ENDIF
!ENDIF

CC=cl
LINK=link
NMAKE = nmake /$(MAKEFLAGS)

SRC_DIR = c_src

# Scenic.Math.Line.parallel({{1,2},{3,4}}, 4)

calling_from_make:
mix compile

all: clean priv Makefile.auto.win NIF

clean:
del /Q /F priv

priv:
mkdir priv

Makefile.auto.win:
erl -eval "io:format(\"~s~n\", [lists:concat([\"ERTS_INCLUDE_PATH=\", code:root_dir(), \"/erts-\", erlang:system_info(version), \"/include\"])])" -s init stop -noshell > $@

NIF: priv\line.dll priv\matrix.dll

!IFDEF ERTS_INCLUDE_PATH
priv\line.obj:
$(CC) -c $(ERL_CFLAGS) $(CFLAGS) /I"$(ERTS_INCLUDE_PATH)" /LD /MD /Fo: $@ $(SRC_DIR)\line.c

priv\line.dll: priv\line.obj
$(LINK) /DLL /OUT:priv\line.dll priv\line.obj

priv\matrix.obj:
$(CC) -c $(ERL_CFLAGS) $(CFLAGS) /I"$(ERTS_INCLUDE_PATH)" /LD /MD /Fo: $@ $(SRC_DIR)\matrix.c
priv\matrix.dll: priv\matrix.obj
$(LINK) /DLL /OUT:priv\matrix.dll priv\matrix.obj

!ELSE
priv\line.dll: Makefile.auto.win
$(NMAKE) /F Makefile.win priv\line.dll
priv\matrix.dll: Makefile.auto.win
$(NMAKE) /F Makefile.win priv\matrix.dll
!ENDIF

0 comments on commit c1458c4

Please sign in to comment.