diff options
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 |