reactos/rosapps/roscalc/makefile
Timo Kreuzer ca60bdfbe8 New version of calc written by Carlo Bramini (carlo(dot)bramix AT libero.it)
Better than the one we currently have. For now in rosapps, so we can test it, if it's all working fine, we should replace the wine one.
Changes by me: use pow() instead of cbrt(), as cbrt doesn't work in our tree.
I imported the whole codebase, although the mpfr files are not used.
I moved the localizations to "lang" and the icons to "res" subfolder.

svn path=/trunk/; revision=31512
2007-12-31 05:51:52 +00:00

82 lines
1.6 KiB
Makefile

# Makefile for ReactOS Calc
#
# syntax:
# make <platform> <precision>
#
# parameters:
# <platform>
# x68_64=1 : compile for x86_64
# undefined: use default tools (typically IA_32)
# <precision>
# gnu-mp=1 : compile with GNU multi precision library
# undefined: use standard IEEE precision
# Default tools
TOOL_PREFIX=
ifdef x86-64
TOOL_PREFIX=x86_64-pc-mingw32-
endif
CPP = $(TOOL_PREFIX)g++.exe
CC = $(TOOL_PREFIX)gcc.exe
WINDRES = $(TOOL_PREFIX)windres.exe
# Define some variables
INCLUDE =
DEBUG = -Wall
OPTIMIZE = -O2 -fomit-frame-pointer
ifdef x86-64
# nothing here
else
OPTIMIZE+= -mpreferred-stack-boundary=2
endif
# Strip, typical mingw flag, help library
LIBS = -s -mwindows -lhtmlhelp
# Check if precision is specified
ifndef gnu-mp
gnu_mp=1
endif
# Check the precision flags
ifeq ($(gnu-mp), 1)
PRECISION=gmp
DEFS += -DENABLE_MULTI_PRECISION
FILES = rpn_mpfr about fun_mpfr utl_mpfr winmain
LIBS += -lgmp -lmpfr
else
PRECISION=ieee
DEFS +=
FILES = rpn about function utl winmain
LIBS += -lm
endif
CFLAGS = $(DEFS) $(INCLUDE) $(DEBUG) $(OPTIMIZE)
DIR_OBJECTS = obj/$(TOOL_PREFIX)$(PRECISION)/
# target file name
TARGET = $(DIR_OBJECTS)calc.exe
OBJS= $(addprefix $(DIR_OBJECTS), $(addsuffix .o, $(FILES)))
RES = $(DIR_OBJECTS)resource.res
.PHONY: all all-before all-after clean clean-custom
all: all-before $(TARGET) all-after
clean: clean-custom
$(RM) $(OBJ) $(TARGET)
$(TARGET): $(OBJS) $(RES)
$(CC) $^ -o $@ $(LIBS)
$(DIR_OBJECTS)%.o: %.c
$(CC) -c $< -o $@ $(CFLAGS)
$(RES): resource.rc
$(WINDRES) -i $< --input-format=rc -o $@ -O coff