diff --git a/fteqtv/Makefile b/fteqtv/Makefile index 0bab3097c..eed391186 100644 --- a/fteqtv/Makefile +++ b/fteqtv/Makefile @@ -1,15 +1,25 @@ -CC=gcc +CC=$(TOOLPREFIX)gcc +AR=$(TOOLPREFIX)ar +RANLIB=$(TOOLPREFIX)ranlib +STRIP=$(TOOLPREFIX)strip + SPIKEISALAZYBUGGERCFLAGS=-Wall -O2 -STRIP=strip STRIPFLAGS=--strip-unneeded --remove-section=.comment OBJS = netchan.o parse.o msg.o qw.o source.o bsp.o rcon.o mdfour.o crc.o control.o forward.o pmove.o httpsv.o +all: qtv + %.o: %.c $(CC) $(SPIKEISALAZYBUGGERCFLAGS) $(CFLAGS) $< -c -o $@ -qtv: $(OBJS) qtv.h - $(CC) $(SPIKEISALAZYBUGGERCFLAGS) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $@.db -lm +libqtvc: + $(MAKE) -C libqtvc CC="$(CC)" CFLAGS="$(CFLAGS) $(SPIKEISALAZYBUGGERCFLAGS)" AR="$(AR)" RANLIB="$(RANLIB)" + +libqtvc/libqtvc.a: libqtvc + +qtv: libqtvc/libqtvc.a $(OBJS) qtv.h + $(CC) $(SPIKEISALAZYBUGGERCFLAGS) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $@.db -lm -lc -L libqtvc -lqtvc $(STRIP) $(STRIPFLAGS) $@.db -o $@ qtv.exe: *.c *.h @@ -18,3 +28,7 @@ qtv.exe: *.c *.h clean: rm -rf qtv qtv.exe qtv.db *.o + $(MAKE) -C libqtvc clean + +.PHONY: libqtvc +