add agsex: extract files/scripts in 1 go, and create Makefile
[rofl0r-agsutils.git] / Makefile
blob3774ab2d6eb1739f0441d773d1a89f51cf4aae61
1 prefix=/usr/local
2 bindir=$(prefix)/bin
4 PROGS_SRCS = \
5 agstract.c \
6 agspack.c \
7 agscriptxtract.c \
8 agssemble.c \
9 agsdisas.c \
10 agssim.c \
11 agsinject.c
13 PROGS_OBJS = $(PROGS_SRCS:.c=.o)
14 PROGS = $(PROGS_SRCS:.c=) agsoptimize agsex
16 LIB_SRCS = \
17 Assembler.c \
18 ByteArray.c \
19 Clib32.c \
20 DataFile.c \
21 File.c \
22 List.c \
23 MemGrow.c \
24 RoomFile.c \
25 Script.c \
26 StringEscape.c
28 LIB_OBJS = $(LIB_SRCS:.c=.o)
30 CFLAGS_WARN = -Wall -Wextra -Wno-unknown-pragmas -Wno-sign-compare
32 -include config.mak
34 all: $(PROGS)
36 $(PROGS): $(LIB_OBJS)
38 %.o: %.c
39 $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_WARN) -o $@ -c $<
41 %: %.o $(LIB_OBJS)
42 $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_WARN) -o $@ $^ $(LDFLAGS)
44 rcb:
45 make -f Makefile.binary FNAME=agstract
46 make -f Makefile.binary FNAME=agspack
47 make -f Makefile.binary FNAME=agscriptxtract
48 make -f Makefile.binary FNAME=agssemble
49 make -f Makefile.binary FNAME=agsdisas
50 make -f Makefile.binary FNAME=agsinject
51 make -f Makefile.binary FNAME=agssim
53 clean:
54 rm -f $(PROGS) $(LIB_OBJS) $(PROGS_OBJS)
55 rm -f *.out
56 rm -f *.o
57 rm -f *.rcb
59 install: $(PROGS:%=$(DESTDIR)$(bindir)/%)
61 $(DESTDIR)$(bindir)/%: %
62 install -D -m 755 $< $@
64 .PHONY: all clean