| |
|
| comp ?= gcc |
comp ?= gcc |
| |
cc ?= gcc |
| |
|
| ifeq (${comp},msvc) |
ifeq ($(comp),msvc) |
| CC = cl /nologo |
CC = $(cc) -nologo |
| version = cl |
version = $(cc) |
| |
|
| opt ?= /Ox |
opt ?= -Ox |
| |
|
| obj = .obj |
obj = .obj |
| exe = .exe |
exe = .exe |
| |
|
| objo = /Fo |
ifeq ($(shell uname),Linux) |
| exeo = /Fe |
|
| |
|
| D = /D |
|
| I = /I |
|
| c = /c |
|
| |
|
| run = wine |
run = wine |
| endif |
endif |
| |
endif |
| |
|
| ifeq (${comp},icc) |
ifeq ($(comp),icc) |
| CC = icc $(std) |
CC = $(cc) $(std) |
| version = icc -v |
version = $(cc) -v |
| |
|
| opt ?= -O3 |
opt ?= -O3 |
| endif |
endif |
| |
|
| ifeq (${comp},gcc) |
ifeq ($(comp),gcc) |
| CC = gcc -Wall -pedantic $(std) |
CC = $(cc) -Wall -pedantic $(std) |
| version = gcc -v |
version = $(cc) -v |
| |
|
| opt ?= -O2 -fomit-frame-pointer |
opt ?= -O2 -fomit-frame-pointer |
| arch ?= -march=pentium4 |
|
| endif |
endif |
| |
|
| obj ?= .o |
ifeq ($(comp),cc) |
| exe ?= |
CC = $(cc) |
| |
|
| objo ?= -o $(empty) |
ifeq ($(shell uname),HP-UX) |
| exeo ?= -o $(empty) |
version = ($(cc) -V -E - < /dev/null > /dev/null) |
| |
else |
| |
version = $(cc) -V |
| |
endif |
| |
|
| |
opt ?= -fast |
| |
endif |
| |
|
| D ?= -D |
obj ?= .o |
| I ?= -I |
exe ?= |
| c ?= -c |
|
| |
|
| %$(obj): %.c |
%$(obj): %.c |
| $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) $(c) $(objo)$@ $< |
$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $< |
| |
|
| %$(id)$(exe): %$(obj) |
%$(id)$(exe): %$(obj) |
| $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(exeo)$@ |
$(CC) $(LDFLAGS) $(TARGET_ARCH) $^ -o $@ |
| strip $@ |
|
| |
|
| version: |
version: |
| @$(version) 2>&1 |
@$(version) 2>&1 |