-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
43 lines (38 loc) · 1.32 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Makefile to compile the 'Scratch' Tool for Tuxpaint
# @author: Sreejith K <[email protected]>
# Created on 8th Apr 2011
CC := gcc
SDL_LIB_PATH := /usr/include/SDL
TP_LIB_PATH := /usr/local/include/tuxpaint
TP_PLUGIN_DIR := /usr/local/lib/tuxpaint/plugins
TP_DATA_DIR := /usr/local/share/tuxpaint
PLUGIN_NAME := scratch
SOURCE_PATH := src/$(PLUGIN_NAME).c
ICON_PATH := resources/$(PLUGIN_NAME).png
SOUND_PATH := resources/$(PLUGIN_NAME).wav
CFLAGS := -I$(SDL_LIB_PATH) -D_GNU_SOURCE=1 -D_REENTRANT -I$(TP_LIB_PATH) -std=c99
BUILD_DIR := build
build: clean
@echo "Compiling plugin"
mkdir $(BUILD_DIR)
$(CC) --shared $(CFLAGS) $(SOURCE_PATH) -o $(BUILD_DIR)/$(PLUGIN_NAME).so
@echo "Done."
install:
@echo "Installing plugin"
cp $(BUILD_DIR)/$(PLUGIN_NAME).so $(TP_PLUGIN_DIR)
cp $(ICON_PATH) $(TP_DATA_DIR)/images/magic
cp $(SOUND_PATH) $(TP_DATA_DIR)/sounds/magic
chmod 644 $(TP_PLUGIN_DIR)/$(PLUGIN_NAME).so
chmod 644 $(TP_DATA_DIR)/images/magic/$(PLUGIN_NAME).png
chmod 644 $(TP_DATA_DIR)/sounds/magic/$(PLUGIN_NAME).wav
@echo "Done."
uninstall: clean
@echo "Uninstalling installed plugin"
rm -f $(TP_PLUGIN_DIR)/$(PLUGIN_NAME).so
rm -f $(TP_DATA_DIR)/images/magic/$(PLUGIN_NAME).png
rm -f $(TP_DATA_DIR)/sounds/magic/$(PLUGIN_NAME).wav
@echo "Done."
clean:
@echo "Cleaning up build files"
rm -rf $(BUILD_DIR)
@echo "Done."