1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-14 22:03:27 +01:00
cnc-ddraw/Makefile

43 lines
1.2 KiB
Makefile
Raw Normal View History

2019-04-08 04:16:20 +02:00
-include config.mk
2024-04-25 00:57:54 +02:00
TARGET = ddraw.dll
LDFLAGS = -Wl,--enable-stdcall-fixup -s -static -shared
2024-03-15 17:07:40 +01:00
CFLAGS = -Iinc -O2 -march=i486 -Wall
2024-05-10 02:43:40 +02:00
LIBS = -lgdi32 -lwinmm -ldbghelp -lole32
2018-08-03 03:37:23 +02:00
2024-09-13 12:34:22 +02:00
COMMIT := $(shell git describe --match=NeVeRmAtCh --always --dirty || echo UNKNOWN)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD || echo UNKNOWN)
CMDTEST := $(shell echo \"\")
ifeq ($(CMDTEST),\"\")
# Windows
ECOMMIT := $(shell echo #define GIT_COMMIT "$(COMMIT)" > inc/git.h)
EBRANCH := $(shell echo #define GIT_BRANCH "$(BRANCH)" >> inc/git.h)
else
2024-09-13 13:01:14 +02:00
# Either *nix or Windows with sh.exe (e.g. w64devkit)
2024-09-13 12:34:22 +02:00
ECOMMIT := $(shell echo \#define GIT_COMMIT \"$(COMMIT)\" > inc/git.h)
EBRANCH := $(shell echo \#define GIT_BRANCH \"$(BRANCH)\" >> inc/git.h)
endif
2024-09-01 09:40:46 +02:00
2024-04-25 00:57:54 +02:00
CC = i686-w64-mingw32-gcc
WINDRES ?= i686-w64-mingw32-windres
2024-04-26 01:41:38 +02:00
ifdef DEBUG
CFLAGS += -D _DEBUG -D _DEBUG_X
endif
2024-08-11 08:58:00 +02:00
SRCS := $(wildcard src/*.c) $(wildcard src/*/*.c) res.rc
OBJS := $(addsuffix .o, $(basename $(SRCS)))
2024-05-03 07:40:04 +02:00
2024-04-25 00:57:54 +02:00
.PHONY: clean all
all: $(TARGET)
2017-11-16 19:19:17 +01:00
2024-05-03 07:40:04 +02:00
%.o: %.rc
$(WINDRES) -J rc $< $@
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^ exports.def $(LIBS)
2010-10-10 19:41:47 +03:00
clean:
2024-09-13 12:34:22 +02:00
$(RM) $(TARGET) $(OBJS) || del $(TARGET) $(subst /,\\,$(OBJS))