Blame src/general/Makefile

nsz 63c044
CFLAGS+=-pipe -std=c99 -D_POSIX_C_SOURCE=200809L -Wall -Wno-unused-function -Wno-missing-braces
nsz 63c044
LDFLAGS+=
nsz 63c044
nsz 63c044
SRC=$(sort $(wildcard *.c))
nsz 63c044
OBJ=$(SRC:.c=.o)
nsz 63c044
DSOOBJ=$(filter %_dso.o,$(OBJ))
nsz 63c044
BINOBJ=$(filter-out %_dso.o,$(OBJ))
nsz 63c044
DSO=$(DSOOBJ:.o=.so)
nsz 63c044
BIN=$(BINOBJ:.o=)
nsz 63c044
nsz 63c044
-include ../../config.mak
nsz 63c044
nsz 63c044
all: $(BIN) $(DSO)
nsz 63c044
run: all
nsz 63c044
	@N=0; for i in $(BIN);do ./$$i || N=$$((N+1)); done; [ "$$N" = 0 ] && echo PASS || echo FAILS: $$N
nsz 63c044
clean:
nsz 63c044
	rm -f $(OBJ) $(DSO) $(BIN)
nsz 63c044
nsz 63c044
$(OBJ): test.h
nsz 63c044
$(DSOOBJ): CFLAGS += -fPIC
nsz 63c044
%.so: %.o
nsz 63c044
	$(CC) $(LDFLAGS) -shared -o $@ $<
nsz 63c044
%: %.o
nsz 63c044
	$(CC) $(LDFLAGS) -o $@ $(patsubst %.so,./%.so,$+)
nsz 49b23c
nsz 49b23c
dlopen: LDFLAGS+=-ldl -rdynamic
nsz 49b23c
pthread: LDFLAGS+=-lpthread
nsz 49b23c
sem: LDFLAGS+=-lpthread -lrt
nsz 49b23c
strtod_simple: LDFLAGS+=-lm
nsz 49b23c
tls_align: tls_align_dso.so
nsz 49b23c
tls_align_dlopen: LDFLAGS+=-ldl