Skip to content

Commit

Permalink
[PLTB] Rewrite Makefiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Hoff committed Jul 3, 2015
1 parent efc368b commit b609084
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 70 deletions.
24 changes: 13 additions & 11 deletions Makefile.nompi → Makefile.static
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ UNAME := $(shell uname)
TARGET=pltb.out
CC=gcc
ifeq ($(UNAME), Darwin)
LFLAGS=-lm
LFLAGS_STATIC=-Wl,-Bstatic
LFLAGS_DYNAMIC=-Wl,-Bdynamic -lm
else
LFLAGS=-lm -lrt
LFLAGS_STATIC=-Wl,-Bstatic
LFLAGS_DYNAMIC=-Wl,-Bdynamic -lm -lrt
endif
CFLAGS=-c -O3 -std=gnu99 -Wall -Wextra -Wredundant-decls -Wswitch-default \
-Wimport -Wno-int-to-pointer-cast -Wbad-function-cast \
Expand All @@ -19,38 +21,38 @@ default: avx

clang: CC := clang
clang: CFLAGS += -Weverything -pedantic
clang: LFLAGS += -l pll-avx
clang: LFLAGS_STATIC += -l pll-avx
clang: $(TARGET)

avx: LFLAGS += -l pll-avx
avx: LFLAGS_STATIC += -l pll-avx
avx: $(TARGET)

avx-pthreads: LFLAGS += -l pll-avx-pthreads
avx-pthreads: LFLAGS_STATIC += -l pll-avx-pthreads
avx-pthreads: $(TARGET)

sse3: LFLAGS += -l pll-sse3
sse3: LFLAGS_STATIC += -l pll-sse3
sse3: $(TARGET)

sse3-pthreads: LFLAGS += -l pll-sse3-pthreads
sse3-pthreads: LFLAGS_STATIC += -l pll-sse3-pthreads
sse3-pthreads: $(TARGET)

debug: CFLAGS += -DDEBUG -g -O0
debug: CFLAGS := $(filter-out -O3,$(CFLAGS))
debug: LFLAGS += -l pll-avx
debug: LFLAGS_STATIC += -l pll-avx
debug: $(TARGET)

debug-sse3: CFLAGS += -DDEBUG -g -O0
debug-sse3: CFLAGS := $(filter-out -O3,$(CFLAGS))
debug-sse3: LFLAGS += -l pll-sse3
debug-sse3: LFLAGS_STATIC += -l pll-sse3
debug-sse3: $(TARGET)

%.o: %.c $(HEADERS)
$(MCC) $(CFLAGS) -c $< -o $@
$(CC) $(CFLAGS) -c $< -o $@

.PRECIOUS: $(TARGET) $(OBJECTS)

$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) $(LFLAGS) -o $@
$(CC) $(OBJECTS) $(LFLAGS_STATIC) $(LFLAGS_DYNAMIC) -o $@

clean:
-rm -f src/*.o
Expand Down
59 changes: 0 additions & 59 deletions Makefile.static_pll

This file was deleted.

0 comments on commit b609084

Please sign in to comment.