aboutsummaryrefslogblamecommitdiff
path: root/Makefile
blob: bc2e86a1b8a81db2bbec8ad8cd5b5a9c8c3e896c (plain) (tree)
1
2
3
4
5
6


                       
        
                                                 
 






                             


                                                                


         

                
                                         
                                                                             
 

                 
                     
NAME = clak
PREFIX = $(HOME)/.local

CC = gcc
CFLAGS += -std=c99 -Wall -Wextra -Wshadow -Werror

ifeq ($(OS),Windows_NT)
    LDLIBS = -lWinmm
    PLATFORM = win32
else
    UNAME_S := $(shell uname)
    ifeq ($(UNAME_S),Linux)
        PLATFORM = linux
		PKG_CONF_LIBS = sdl2 SDL2_mixer x11 xi
		CFLAGS += `pkg-config --cflags $(PKG_CONF_LIBS)`
		LDLIBS += `pkg-config --libs $(PKG_CONF_LIBS)`
    endif
endif

default: $(NAME)

$(NAME): $(NAME).c platform/$(PLATFORM).c
	$(CC) $(CFLAGS) $(NAME).c platform/$(PLATFORM).c $(LDLIBS) -o $(NAME)

clean:
	rm -f *.o
	rm -f $(NAME)