Skip to content

Commit

Permalink
change makefile to compile both mex and library
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Jul 11, 2019
1 parent 274ce37 commit 0412419
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MEX=mex
AR=$(CC)
ECHO := echo

BINARY:=zmat
BINARY:=zipmat
OUTPUT_DIR=$(ZMATDIR)

DOXY := doxygen
Expand All @@ -30,7 +30,7 @@ CUOMPLINK=
ARCH = $(shell uname -m)
PLATFORM = $(shell uname -s)

DLLFLAG=
DLLFLAG=-fPIC
OMP=-fopenmp

CPPOPT=-g -Wall -O3 #-g -Wall -std=c99 # -DUSE_OS_TIMER
Expand Down Expand Up @@ -75,6 +75,11 @@ else
endif
endif

lib: AR :=ar
lib: ARFLAGS :=cr
lib: AROUTPUT :=

oct mex: CPPOPT+= $(DLLFLAG)
oct: CC=$(MEX)
oct: OUTPUT_DIR=..
oct: AR= CXXFLAGS='-O3' LFLAGS='$(-lz)' LDFLAGS='$(LFLAGS)' mkoctfile zmat.cpp easylzma/easylzma-0.0.8/lib/libeasylzma_s.a
Expand All @@ -90,11 +95,6 @@ mex: LINKOPT+= -cxx CXXLIBS='$$CXXLIBS -lz' -outdir $(ZMATDIR)
mex: ARFLAGS :=
mex: OUTPUT_DIR=..

lib: BINARY=libzmat.a
lib: AR :=ar
lib: ARFLAGS :=cr
lib: AROUTPUT :=

all: mex

TARGETSUFFIX:=$(suffix $(BINARY))
Expand Down Expand Up @@ -136,7 +136,7 @@ $(OUTPUT_DIR)/$(BINARY): $(OBJS)
clean:
-rm -f $(OBJS) $(OUTPUT_DIR)/$(BINARY)$(EXESUFFIX)

.PHONY: all mex oct
.PHONY: all mex oct lib

.DEFAULT_GOAL := all

0 comments on commit 0412419

Please sign in to comment.