-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
49 lines (33 loc) · 1.09 KB
/
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
41
42
43
44
45
46
47
48
49
# -Wno-implicit-fallthrough - the implicit fallthrough is intended so turn off warning
CFLAGS ?= -O2 -Wall -Wextra -Wno-implicit-fallthrough
MAJOR := 1
MINOR := 0
NAME := code128
VERSION := $(MAJOR).$(MINOR)
LIBSO = lib$(NAME).so
LIBSOM = $(LIBSO).$(MAJOR)
LIBSOV = $(LIBSO).$(VERSION)
LIBA = lib$(NAME).a
CODE128PNG_INCLUDE_DIRS :=
CODE128PNG_LIBRARY_DIRS :=
CODE128PNG_LIBRARIES := png
CPPFLAGS += $(foreach includedir,$(CODE128PNG_INCLUDE_DIRS),-I$(includedir))
LDFLAGS += $(foreach librarydir,$(CODE128PNG_LIBRARY_DIRS),-L$(librarydir))
LDFLAGS += $(foreach library,$(CODE128PNG_LIBRARIES),-l$(library))
all: code128png lib
code128png: code128png.o code128.o
$(CC) $^ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@
lib: $(LIBSO) $(LIBA)
$(LIBSO): $(LIBSOV)
ln -s $(LIBSOV) $(LIBSO)
$(LIBSOV): $(NAME).o
$(CC) $(CFLAGS) -shared -Wl,-soname,$(LIBSOM) -o $(LIBSOV) $(NAME).o
$(LIBA): $(NAME).o
$(AR) $(ARFLAGS) $(LIBA) $(NAME).o
clean:
$(RM) -f code128png *.o *.so* *.a
format-code:
astyle --indent-preproc-block *.c *.h
check test: code128png
./test.sh
.PHONY: clean format-code all check test