1CC ?= gcc
2DESTDIR ?= /usr/local
3LD ?= gcc
4C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src
5MAJOR_VERSION = 0
6MINOR_VERSION = 2
7PATCH_VERSION = 8
8VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)"
9SONAME = libucl.dll
10OBJDIR ?= .obj
11TESTDIR ?= tests
12SRCDIR ?= src
13INCLUDEDIR ?= include
14MKDIR ?= mkdir
15INSTALL ?= install
16RM ?= rm
17RMDIR ?= rmdir
18ifeq (Windows_NT, $(OS))
19LN ?= ln
20else
21LN ?= rem ln
22endif
23LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm
24LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl
25LD_ADD ?= -lrt
26COPT_FLAGS ?= -O2
27HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h
28OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o
29
30all: $(OBJDIR) $(OBJDIR)/$(SONAME)
31
32$(OBJDIR)/$(SONAME): $(OBJECTS)
33 $(CC) -o $(OBJDIR)/$(SONAME) $(OBJECTS) $(LD_SHARED_FLAGS) $(LDFLAGS) $(SSL_LIBS) $(FETCH_LIBS)
34
35$(OBJDIR):
36 @$(MKDIR) -p $(OBJDIR)
37
38# Compile rules
39$(OBJDIR)/ucl_util.o: $(SRCDIR)/ucl_util.c $(HDEPS)
40 $(CC) -o $(OBJDIR)/ucl_util.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_util.c
41$(OBJDIR)/ucl_parser.o: $(SRCDIR)/ucl_parser.c $(HDEPS)
42 $(CC) -o $(OBJDIR)/ucl_parser.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_parser.c
43$(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_emitter.c $(HDEPS)
44 $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c
45$(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS)
46 $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c
47$(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS)
48 $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c
49
50clean:
51 $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate
52 $(RMDIR) $(OBJDIR)
53
54# Utils
--- 25 unchanged lines hidden ---
2DESTDIR ?= /usr/local
3LD ?= gcc
4C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src
5MAJOR_VERSION = 0
6MINOR_VERSION = 2
7PATCH_VERSION = 8
8VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)"
9SONAME = libucl.dll
10OBJDIR ?= .obj
11TESTDIR ?= tests
12SRCDIR ?= src
13INCLUDEDIR ?= include
14MKDIR ?= mkdir
15INSTALL ?= install
16RM ?= rm
17RMDIR ?= rmdir
18ifeq (Windows_NT, $(OS))
19LN ?= ln
20else
21LN ?= rem ln
22endif
23LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm
24LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl
25LD_ADD ?= -lrt
26COPT_FLAGS ?= -O2
27HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h
28OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o
29
30all: $(OBJDIR) $(OBJDIR)/$(SONAME)
31
32$(OBJDIR)/$(SONAME): $(OBJECTS)
33 $(CC) -o $(OBJDIR)/$(SONAME) $(OBJECTS) $(LD_SHARED_FLAGS) $(LDFLAGS) $(SSL_LIBS) $(FETCH_LIBS)
34
35$(OBJDIR):
36 @$(MKDIR) -p $(OBJDIR)
37
38# Compile rules
39$(OBJDIR)/ucl_util.o: $(SRCDIR)/ucl_util.c $(HDEPS)
40 $(CC) -o $(OBJDIR)/ucl_util.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_util.c
41$(OBJDIR)/ucl_parser.o: $(SRCDIR)/ucl_parser.c $(HDEPS)
42 $(CC) -o $(OBJDIR)/ucl_parser.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_parser.c
43$(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_emitter.c $(HDEPS)
44 $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c
45$(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS)
46 $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c
47$(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS)
48 $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c
49
50clean:
51 $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate
52 $(RMDIR) $(OBJDIR)
53
54# Utils
--- 25 unchanged lines hidden ---