blob: 60a693ff76e8aee1e03dd607300d54ca28ef089e (
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
42
43
44
|
# source files.
SRC = encode.c
TEST_SRC = test_main.c encode_test.c
OBJ = $(SRC:.c=.o)
TEST_OBJ = $(TEST_SRC:.c=.o)
OUT = libgob.a
# include directories
INCLUDES = -I. -I/usr/local/include
# C++ compiler flags (-g -O2 -Wall)
CCFLAGS ?= -g
# compiler
CC = gcc
# library paths
LIBS = -L../ -L/usr/local/lib -lm
# compile flags
LDFLAGS ?= -g
CUNIT_LDFLAGS= -lcunit
.SUFFIXES: .c
default: $(OUT)
.c.o:
$(CC) $(INCLUDES) $(CCFLAGS) -c $< -o $@
$(OUT): $(OBJ)
ar rcs $(OUT) $(OBJ)
clean:
rm -f $(OBJ) $(TEST_OBJ) $(OUT) Makefile.bak
test: $(OBJ) $(TEST_OBJ)
$(CC) $^ -o $@ -lm $(CUNIT_LDFLAGS)
exe: $(OUT) main.o
$(CC) $^ -o $@ -lm -lgob -L. $(LDFLAGS)
|