libamxo  4.3.4
Object Definition Language (ODL) parsing
makefile
Go to the documentation of this file.
1 TARGET = test_plugin.so
2 
3 SOURCES = $(wildcard *.c)
4 OBJECTS = $(SOURCES:.c=.o)
5 
6 # compilation and linking flags
7 CFLAGS += -Werror -Wall -Wextra \
8  -Wformat=2 -Wshadow \
9  -Wwrite-strings -Wstrict-prototypes -Wold-style-definition \
10  -Wredundant-decls -Wnested-externs -Wmissing-include-dirs \
11  -Wpedantic -Wmissing-declarations \
12  -fPIC --std=c18 -g3 -I../../include/
13 LDFLAGS += -shared -fPIC
14 LDFLAGS += -lamxc -lamxp -lamxd -lamxo
15 
16 # targets
17 all: $(TARGET)
18 
19 $(TARGET): $(OBJECTS)
20  $(CC) -Wl,-soname,$(TARGET).so -o $@ $(OBJECTS) $(LDFLAGS)
21 
22 -include $(OBJECTS:.o=.d)
23 
24 %.o: %.c
25  $(CC) $(CFLAGS) -c -o $@ $<
26  @$(CC) $(CFLAGS) -MM -MP -MT '$(@) $(@:.o=.d)' -MF $(@:.o=.d) $(<)
27 
28 clean:
29  rm -f $(OBJECTS) $(TARGET)
30  rm -f *.d
31 
32 .PHONY: clean