-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (33 loc) · 897 Bytes
/
Makefile
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
# generic compiler and linker settings:
CC = gcc
LD = ld
ifeq ($(ARCH),)
ARCH = $(shell uname -s)
endif
# generic platform specific rules:
ifeq ($(ARCH),Linux)
CFLAGS = -fPIC -O2 -c
SHLIBSUFFIX = .so
LINKFLAGS = -shared -Wl,-no-undefined
else
ifeq ($(ARCH),Darwin) # MacOSX
CFLAGS = -O2 -c
SHLIBSUFFIX = .so
LINKFLAGS = -bundle -L/usr/local/lib
else # mingw
CC = $(ARCH)-gcc
LD = $(ARCH)-ld
CFLAGS = -O2 -c
SHLIBSUFFIX = .dll
LINKFLAGS = -shared -mconsole -s -Wl,-no-undefined,-soname=ewts$(SHLIBSUFFIX) -L.
endif
endif
all: ewts$(SHLIBSUFFIX)
ewts-parser.o: ewts-parser.c ewts-parser.h ewts-common.h
$(CC) $(CFLAGS) ewts-parser.c -o $@
ewts-parser.c: ewts-parser.l
flex ewts-parser.l
ewts$(SHLIBSUFFIX): ewts-parser.o
$(CC) $(LINKFLAGS) ewts-parser.o -o ewts$(SHLIBSUFFIX)
clean:
@rm -f ewts-parser.c ewts-parser.o ewts.so