diff options
author | Nicholas Tay <nick@windblume.net> | 2022-05-07 23:26:27 +1000 |
---|---|---|
committer | Nicholas Tay <nick@windblume.net> | 2022-05-07 23:47:37 +1000 |
commit | 047544a5af9100ec269e9222213385bc7794f619 (patch) | |
tree | 6a632da957c05fb790fdd63745e99b867c945274 /Makefile | |
parent | ecb4cff6f34783fd345419c0069c685793521e80 (diff) | |
download | clak-047544a5af9100ec269e9222213385bc7794f619.tar.gz clak-047544a5af9100ec269e9222213385bc7794f619.tar.bz2 clak-047544a5af9100ec269e9222213385bc7794f619.zip |
Split out platform-specific code for Windows
Not sure if I'm really doing it in the best way possible. Feels a bit
weird that some place assumes the existence of other functions.
Diffstat (limited to '')
-rw-r--r-- | Makefile | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -5,14 +5,23 @@ BOARDS = mxblue quack CC = gcc CFLAGS += -std=c99 -Wall -Wextra -Wshadow -Werror -pedantic -LDLIBS = -lWinmm BOARD_FILES = $(addsuffix /board.h,$(addprefix board/,$(BOARDS))) +ifeq ($(OS),Windows_NT) + LDLIBS = -lWinmm + PLATFORM = win32 +else + UNAME_S := $(shell uname) + ifeq ($(UNAME_S),Linux) + PLATFORM = linux + endif +endif + default: $(NAME) -$(NAME): $(NAME).c $(BOARD_FILES) board/boards.h - $(CC) $(CFLAGS) $(NAME).c $(LDLIBS) -o $(NAME) +$(NAME): $(NAME).c platform/$(PLATFORM).c $(BOARD_FILES) board/boards.h + $(CC) $(CFLAGS) $(NAME).c platform/$(PLATFORM).c $(LDLIBS) -o $(NAME) board/boards.h: printf "#ifndef BOARD_DEFAULTS_H\n#define BOARD_DEFAULTS_H\n\n" > board/boards.h |