forked from pijyoi/jsonrpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmingw.mk
42 lines (31 loc) · 804 Bytes
/
mingw.mk
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
PREFIX ?= .
CFLAGS := -O3 -g -Wall -I$(PREFIX)/include -I.
LINKFLAGS := -L$(PREFIX)/bin -ljansson-4
MAJOR := 1
NAME := jsonrpc
VERSION := $(MAJOR)
TARGET := lib$(NAME)-$(VERSION)
SOURCES := jsonrpc.c
OBJECTS := $(SOURCES:.c=.o)
SHLIB := $(TARGET).dll
STLIB := $(TARGET).a
shlib: $(SHLIB)
stlib: $(STLIB)
$(SHLIB): $(OBJECTS)
$(CC) -shared -o $(TARGET).dll *.o -Wl,--out-implib,$(TARGET).a $(LINKFLAGS)
$(STLIB): $(OBJECTS)
$(AR) rcs $@ $^
clean:
$(RM) *.o *.a *.dll *.la *.so*
all: stlib shlib
install_shlib:
mkdir -p $(PREFIX)/bin
mkdir -p $(PREFIX)/include
cp *.h $(PREFIX)/include
cp $(SHLIB) $(PREFIX)/bin
install_stlib:
mkdir -p $(PREFIX)/lib
mkdir -p $(PREFIX)/include
cp *.h $(PREFIX)/include
cp $(STLIB) $(PREFIX)/lib
install: install_shlib install_stlib