-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.common
43 lines (32 loc) · 1.3 KB
/
Makefile.common
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
include Makefile.defs
CFLAGS += $(LUA_CFLAGS) $(EXTRA_CFLAGS) -DSTEAD_PATH=\"${STEADPATH}/\" -DVERSION=\"$(VERSION)\"
LDFLAGS += $(LUA_LFLAGS) $(EXTRA_LDFLAGS)
INSTEAD_SRC := instead.c util.c list.c cache.c idf.c tinymt32.c lfs.c
SRC := $(INSTEAD_SRC)
OBJ := $(patsubst %.c, %.o, $(SRC))
all: instead-cli$(EXE)
$(OBJ): %.o : instead/src/instead/%.c
$(CC) -c $(<) $(I) $(CFLAGS) $(CPPFLAGS) -o $(@)
update:
git submodule update --recursive --remote
git submodule foreach git checkout master
git submodule foreach git pull origin master
instead-cli$(EXE): main.c $(OBJ)
$(CC) $(CFLAGS) $(^) $(LDFLAGS) -o $(@)
clean:
$(RM) -f *.o instead-cli$(EXE)
install: all
$(INSTALLD) $(DESTDIR)/$(BIN)
$(INSTALLB) instead-cli$(EXE) $(DESTDIR)/$(BIN)/instead-cli$(EXE)
$(INSTALLD) $(DESTDIR)/$(STEADPATH)
for d in stead2 stead3 stead2/ext stead3/ext; do \
$(INSTALLD) $(DESTDIR)/$(STEADPATH)/$$d; \
$(INSTALL) instead/stead/$$d/*.lua $(DESTDIR)/$(STEADPATH)/$$d/; \
done
for d in morph parser; do \
$(INSTALLD) $(DESTDIR)/$(STEADPATH)/stead3/$$d; \
$(INSTALL) metaparser/$$d/* $(DESTDIR)/$(STEADPATH)/stead3/$$d/; \
done
$(INSTALL) instead/src/tiny/tiny2.lua $(DESTDIR)/$(STEADPATH)/stead2/
$(INSTALL) instead/src/tiny/tiny3.lua $(DESTDIR)/$(STEADPATH)/stead3/
$(INSTALL) tiny.lua $(DESTDIR)/$(STEADPATH)/