dpmodel/Makefile
havoc 6b4a42106c new makefile with mingw support built in
git-svn-id: svn://svn.icculus.org/twilight/trunk/dpmodel@5728 d7cf8633-e32d-0410-b094-e92efae38249
2005-09-28 09:12:27 +00:00

45 lines
672 B
Makefile

##### Win32 variables #####
WIN32_EXE=dpmodel.exe
WIN32_LDFLAGS=-lm
##### Unix variables #####
UNIX_EXE=dpmodel
UNIX_LDFLAGS=-lm
##### Common variables #####
CC=gcc
CFLAGS=-MD -Wall -O2
ifdef windir
CMD_RM=del
else
CMD_RM=rm -f
endif
##### Commands #####
.PHONY: all mingw clean
all:
ifdef windir
$(MAKE) EXE=$(WIN32_EXE) LDFLAGS="$(WIN32_LDFLAGS)" $(WIN32_EXE)
else
$(MAKE) EXE=$(UNIX_EXE) LDFLAGS="$(UNIX_LDFLAGS)" $(UNIX_EXE)
endif
mingw:
@$(MAKE) EXE=$(WIN32_EXE) LDFLAGS="$(WIN32_LDFLAGS)" $(WIN32_EXE)
.c.o:
$(CC) $(CFLAGS) -c $*.c
$(EXE): dpmodel.o
$(CC) -o $@ $^ $(LDFLAGS)
clean:
-$(CMD_RM) $(WIN32_EXE)
-$(CMD_RM) $(UNIX_EXE)
-$(CMD_RM) *.o