root/luci2/cbi2/Makefile @ 5667

Revision 5667, 0.9 KB (checked in by Cyrus, 3 years ago)

strict aliasiang breaks compilation on amd64

Line 
1CC?=gcc
2CFLAGS?=-O2
3CFLAGS+=-I./include --std=gnu99 -Wall -Werror -pedantic -fno-strict-aliasing -I/usr/include/lua5.1/
4LDFLAGS?=
5LIBS=-llua5.1
6BINARY=lucic luci uvl uvlc liblmo.a lmo_po2lmo
7
8all: $(BINARY)
9
10lucic: lucic.o lucip.o blob.o
11    $(CC) $(CFLAGS) -o $@ $^
12
13luci: luci.c cbi.c validate.c uvl.c blob.c widget.c validator/boolean.c widgets/page.c widgets/form.c widgets/section.c widgets/option.c widgets/field.c widgets/foreach.c widgets/file.c widgets/stemplate.c
14    $(CC) $(CFLAGS) -o $@ $^
15
16uvl: uvl.o uvl-cli.o blob.o
17    $(CC) $(CFLAGS) -o $@ $^
18
19uvlc: uvlc.o blob.o
20    $(CC) $(CFLAGS) $(LIBS) -o $@ $^
21
22liblmo.a: lmo_core.o lmo_hash.o
23    $(AR) rc $@ $^
24
25lmo_po2lmo: lmo_po2lmo.o lmo_hash.o
26    $(CC) -o $@ $^
27   
28install:
29    mkdir -p $(DESTDIR)/usr/lib/ $(DESTDIR)/usr/include/
30    cp libcbi.a $(DESTDIR)/usr/lib/
31    cp *.h $(DESTDIR)/usr/include/
32
33clean:
34    rm -f $(BINARY) *.luco *.o widgets/*.o validators/*.o
35
36%.o: $(wildcard *.h)
37%.o: %.c
38    $(CC) $(CFLAGS) -c -o $@ $^
Note: See TracBrowser for help on using the browser.