Skip to content

Commit b609084

Browse files
author
Michael Hoff
committed
[PLTB] Rewrite Makefiles.
1 parent efc368b commit b609084

File tree

2 files changed

+13
-70
lines changed

2 files changed

+13
-70
lines changed

Makefile.nompi renamed to Makefile.static

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ UNAME := $(shell uname)
22
TARGET=pltb.out
33
CC=gcc
44
ifeq ($(UNAME), Darwin)
5-
LFLAGS=-lm
5+
LFLAGS_STATIC=-Wl,-Bstatic
6+
LFLAGS_DYNAMIC=-Wl,-Bdynamic -lm
67
else
7-
LFLAGS=-lm -lrt
8+
LFLAGS_STATIC=-Wl,-Bstatic
9+
LFLAGS_DYNAMIC=-Wl,-Bdynamic -lm -lrt
810
endif
911
CFLAGS=-c -O3 -std=gnu99 -Wall -Wextra -Wredundant-decls -Wswitch-default \
1012
-Wimport -Wno-int-to-pointer-cast -Wbad-function-cast \
@@ -19,38 +21,38 @@ default: avx
1921

2022
clang: CC := clang
2123
clang: CFLAGS += -Weverything -pedantic
22-
clang: LFLAGS += -l pll-avx
24+
clang: LFLAGS_STATIC += -l pll-avx
2325
clang: $(TARGET)
2426

25-
avx: LFLAGS += -l pll-avx
27+
avx: LFLAGS_STATIC += -l pll-avx
2628
avx: $(TARGET)
2729

28-
avx-pthreads: LFLAGS += -l pll-avx-pthreads
30+
avx-pthreads: LFLAGS_STATIC += -l pll-avx-pthreads
2931
avx-pthreads: $(TARGET)
3032

31-
sse3: LFLAGS += -l pll-sse3
33+
sse3: LFLAGS_STATIC += -l pll-sse3
3234
sse3: $(TARGET)
3335

34-
sse3-pthreads: LFLAGS += -l pll-sse3-pthreads
36+
sse3-pthreads: LFLAGS_STATIC += -l pll-sse3-pthreads
3537
sse3-pthreads: $(TARGET)
3638

3739
debug: CFLAGS += -DDEBUG -g -O0
3840
debug: CFLAGS := $(filter-out -O3,$(CFLAGS))
39-
debug: LFLAGS += -l pll-avx
41+
debug: LFLAGS_STATIC += -l pll-avx
4042
debug: $(TARGET)
4143

4244
debug-sse3: CFLAGS += -DDEBUG -g -O0
4345
debug-sse3: CFLAGS := $(filter-out -O3,$(CFLAGS))
44-
debug-sse3: LFLAGS += -l pll-sse3
46+
debug-sse3: LFLAGS_STATIC += -l pll-sse3
4547
debug-sse3: $(TARGET)
4648

4749
%.o: %.c $(HEADERS)
48-
$(MCC) $(CFLAGS) -c $< -o $@
50+
$(CC) $(CFLAGS) -c $< -o $@
4951

5052
.PRECIOUS: $(TARGET) $(OBJECTS)
5153

5254
$(TARGET): $(OBJECTS)
53-
$(CC) $(OBJECTS) $(LFLAGS) -o $@
55+
$(CC) $(OBJECTS) $(LFLAGS_STATIC) $(LFLAGS_DYNAMIC) -o $@
5456

5557
clean:
5658
-rm -f src/*.o

Makefile.static_pll

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)