-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
51 lines (35 loc) · 1 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
44
45
46
47
48
49
50
51
################################################################################
# Ben Baker 2020
#
# Makefile for compiling gfx2next
################################################################################
.PHONY: all install distro clean
CC := gcc
MKDIR := mkdir -p
RM := rm -rf
CP := cp
ZIP := zip -r -q
BUILD_DIR := build
TMP_DIR := tmp
EXE_BASE_NAME := gfx2next
EXE_FULL_NAME := $(BUILD_DIR)/$(EXE_BASE_NAME)
# common GNU variables related to install location
prefix ?= /usr/local
exec_prefix ?= $(prefix)
bindir ?= $(exec_prefix)/bin
all: $(EXE_FULL_NAME)
install: $(EXE_FULL_NAME)
$(CP) $^ $(bindir)/$(^F)
distro: clean
$(MAKE) all
$(MKDIR) $(TMP_DIR)/gfx2next
$(CP) $(BUILD_DIR)/* $(TMP_DIR)/gfx2next
$(CP) src/* $(TMP_DIR)/gfx2next
$(CP) README.md $(TMP_DIR)/gfx2next
$(RM) build/gfx2next.zip
cd $(TMP_DIR); $(ZIP) ../build/gfx2next.zip gfx2next
clean:
$(RM) $(BUILD_DIR) $(TMP_DIR)
$(EXE_FULL_NAME): src/lodepng.c src/zx0.c src/gfx2next.c
$(MKDIR) $(@D)
$(CC) -O2 -Wall -o $@ $^ -lm