Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Makefile « myhtml « source - github.com/lexborisov/perl-html-myhtml.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fea345f78413719bdcdd45218fc6bbf23d40122a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
TARGET := myhtml
SRCDIR := myhtml

CC ?= gcc

LIBPOSTFIX := .so
LIBNAME    := myhtml
LIBSTATIC_PREFIX  := static_

CFLAGS ?= -Wall -Werror -O2 -fPIC --std=c99 -pthread -I..

ifeq ($(OS),Windows_NT)
else
	UNAM := $(shell uname -s)
	ifeq ($(UNAM),Darwin)
		LIBPOSTFIX := .dylib
	else
		CFLAGS += -D_POSIX_C_SOURCE=199309L
	endif
endif

SRCS := $(wildcard *.c)
SRCS += $(wildcard utils/*.c)
HDRS := $(wildcard *.h)
HDRS += $(wildcard utils/*.h)
OBJS := $(patsubst %.c, %.o, $(SRCS))

all: shared static

shared: $(OBJS) $(HDRS)
	$(CC) -shared $(LDFLAGS) $(OBJS) -o lib$(LIBNAME)$(LIBPOSTFIX)

static: shared
	$(AR) crus $(LIBSTATIC_PREFIX)lib$(LIBNAME).a $(OBJS)

clean:
	rm -rf *.o
	rm -rf utils/*.o
	rm -rf *lib$(LIBNAME)*

.PHONY: all clean