-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (28 loc) · 900 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
CC=gcc
SRC=./src
INC=./headers
OBJ=./obj
BIN=./bin
LIB=./lib
AR=ar
lib_static:
$(CC) -I$(INC) -Wall -c $(SRC)/*.c
mv *.o $(OBJ)/static
$(AR) -rcs $(LIB)/static/libregex.a $(OBJ)/static/*.o
lib_shared:
$(CC) -I$(INC) -Wall -fPIC -c $(SRC)/*.c
mv *.o $(OBJ)/shared
$(CC) -shared $(OBJ)/shared/automata.o $(OBJ)/shared/regex.o -Wl,-soname,libregex.so.1 -o $(LIB)/shared/libregex.so.1.0.0
tests:
$(CC) -I$(INC) -Wall -c $(SRC)/*.c
mv *.o $(OBJ)/static
$(AR) -rcs $(LIB)/static/libregex.a $(OBJ)/static/*.o
$(CC) $(OBJ)/static/tests.o -L$(LIB)/static/ -g -lregex -o $(BIN)/tests
tests_debug:
$(CC) -I$(INC) -g -Wall -D DEBUG -c $(SRC)/*.c
mv *.o $(OBJ)/static
$(AR) -rcs $(LIB)/static/libregex.a $(OBJ)/static/*.o
$(CC) $(OBJ)/static/tests.o -L$(LIB)/static/ -g -lregex -o $(BIN)/tests
all: lib_static lib_shared
clean:
rm -f bin/* lib/static/* lib/shared/* obj/static/* obj/shared/*