Skip to content

Commit

Permalink
fix #1: Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
zvezdochiot committed Dec 7, 2021
1 parent 7afedb3 commit af2a9f0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
32 changes: 20 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
PROJECT = lossywav
COMMON_CXXFLAGS = -std=c++11 -O2 -pipe
DEFINES = -DHAVE_STD_CHRONO_STEADY_CLOCK_NOW -DHAVE_SETPRIORITY -DHAVE_STAT -DHAVE_CHMOD -DHAVE_NANOSLEEP
AR = ar
LDFLAGS = -s

CXXFLAGS = ${COMMON_CXXFLAGS} ${DEFINES}
ifeq ($(shell uname --machine), x86_64)
CXXFLAGS += -fPIC
endif
ifeq ($(shell uname --machine), aarch64)
CXXFLAGS += -fPIC
endif

HEADERS = version.h \
units/fftw_interface.h \
units/nComplex.h \
Expand Down Expand Up @@ -32,22 +46,16 @@ OBJS = units/fftw_interface.o \

OBJB = lossyWAV.o

COMMON_CXXFLAGS = -std=c++11 -O2 -pipe
DEFINES = -DHAVE_STD_CHRONO_STEADY_CLOCK_NOW -DHAVE_SETPRIORITY -DHAVE_STAT -DHAVE_CHMOD -DHAVE_NANOSLEEP
LDFLAGS = -s


all: prep $(OBJS) $(OBJB) link

prep:
$(eval override CXXFLAGS = ${COMMON_CXXFLAGS} ${CXXFLAGS} ${DEFINES})
all: $(OBJS) $(OBJB) link

*.o: ${@:.o=.cpp} $(HEADERS)
${CXX:-g++} -c ${@:.o=.cpp} -o ${@} ${CXXFLAGS}

link: $(OBJS) $(OBJB)
${CXX} -shared ${OBJS} -Wl,-soname,liblossywav.so.1 -o liblossywav.so.1 ${LDFLAGS}
${CXX} liblossywav.so.1 ${OBJB} -o lossywav ${LDFLAGS}
${AR} crs lib${PROJECT}.a ${OBJS}
${CXX} -shared ${OBJS} -Wl,-soname,lib${PROJECT}.so.1 -o lib${PROJECT}.so.1 ${LDFLAGS}
${CXX} ${OBJB} lib${PROJECT}.so.1 -o ${PROJECT} ${LDFLAGS}
${CXX} ${OBJB} lib${PROJECT}.a -o ${PROJECT}-static ${LDFLAGS}

clean:
-rm -f $(OBJS) $(OBJB) liblossywav.so.1 lossywav
-rm -f $(OBJS) $(OBJB) lib${PROJECT}.a lib${PROJECT}.so.1 ${PROJECT} ${PROJECT}-static
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
![GitHub release (latest by date)](https://img.shields.io/github/v/release/Sound-Linux-More/lossywav-for-linux)
![GitHub Release Date](https://img.shields.io/github/release-date/Sound-Linux-More/lossywav-for-linux)
![GitHub repo size](https://img.shields.io/github/repo-size/Sound-Linux-More/lossywav-for-linux)
![GitHub all releases](https://img.shields.io/github/downloads/Sound-Linux-More/lossywav-for-linux/total)
![GitHub](https://img.shields.io/github/license/Sound-Linux-More/lossywav-for-linux)

# Note
This is the `README` of **lossyWAV for POSIX**.
The README of lossyWAV (proper) was moved to `README.lossyWAV.md`.
Expand Down

0 comments on commit af2a9f0

Please sign in to comment.