2008-02-10 01:21:45 +00:00
|
|
|
ifeq (Windows_NT,$(OS))
|
|
|
|
WIN=1
|
|
|
|
WINCMD=1
|
2008-04-03 23:16:07 +00:00
|
|
|
ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys)
|
|
|
|
WINCMD=0
|
|
|
|
endif
|
2008-02-10 01:21:45 +00:00
|
|
|
endif
|
2006-08-11 03:07:32 +00:00
|
|
|
|
|
|
|
ifeq (1,$(WIN))
|
2006-04-29 04:52:30 +00:00
|
|
|
EXE = makewad.exe
|
|
|
|
CFLAGS = -Os -Wall -fomit-frame-pointer
|
2006-05-29 09:00:20 +00:00
|
|
|
LDFLAGS = -s -L../../zlib/ -lz
|
2006-05-16 04:19:20 +00:00
|
|
|
ZLIB = ../../zlib/libz.a
|
2006-04-29 04:52:30 +00:00
|
|
|
else
|
|
|
|
EXE = makewad
|
|
|
|
CFLAGS = -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -Os -Wall -fomit-frame-pointer
|
2006-05-29 09:00:20 +00:00
|
|
|
LDFLAGS = -s -lz
|
2006-05-16 04:19:20 +00:00
|
|
|
ZLIB =
|
2006-04-29 04:52:30 +00:00
|
|
|
endif
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-08-11 03:07:32 +00:00
|
|
|
CCDV = @../../ccdv
|
2006-02-24 04:48:15 +00:00
|
|
|
CC = gcc
|
|
|
|
|
2006-04-29 04:52:30 +00:00
|
|
|
OBJS = makewad.o ioapi.o zip.o
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
all: $(EXE)
|
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(CCDV) $(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
2006-05-16 04:19:20 +00:00
|
|
|
$(EXE): $(OBJS) $(ZLIB)
|
|
|
|
$(CCDV) $(CC) -o $(EXE) $(OBJS) $(LDFLAGS)
|
|
|
|
|
2006-08-11 03:07:32 +00:00
|
|
|
ifeq (1,$(WIN))
|
2006-05-16 04:19:20 +00:00
|
|
|
$(ZLIB):
|
|
|
|
make -C ../../zlib -f Makefile.mgw
|
|
|
|
endif
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
clean:
|
2006-08-11 03:07:32 +00:00
|
|
|
ifeq (1,$(WINCMD))
|
2006-02-24 04:48:15 +00:00
|
|
|
-del /q /f $(EXE) 2>nul
|
|
|
|
-del /q /f *.o 2>nul
|
2006-04-29 04:52:30 +00:00
|
|
|
else
|
|
|
|
-rm -f $(EXE)
|
|
|
|
-rm -f *.o
|
|
|
|
endif
|