summaryrefslogtreecommitdiff
blob: e7f6b154efd4047eb3e2fc6c4130c3bf2af6ca74 (plain)
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
--- a/Makefile
+++ b/Makefile
@@ -1,30 +1,21 @@
 TARGET = yeahconsole
-CC = gcc
-#CC = cc
 INSTALL = install
 
-PREFIX = /usr/local
+PREFIX = $(EPREFIX)/usr
 
-LIBS = -lX11 
-INCLUDES = -I/usr/X11R6/include 
-LIB_DIRS = -L/usr/X11R6/lib
-FLAGS = -Os -Wall
-
-OBJECTS := yeahconsole.o
-SOURCES := yeahconsole.c
-
-$(TARGET): $(OBJECTS) 
-	$(CC) $(DEFINES) $(INCLUDES) $(LIB_DIRS) $(LIBS) -o $@ $<
-	strip $@
+PKG_CONFIG ?= lol
+CFLAGS += -Wall
+CPPFLAGS += $(shell $(PKG_CONFIG) --cflags x11)
+LDLIBS += $(shell $(PKG_CONFIG) --libs x11)
 
-$(OBJECTS): $(SOURCES) 
-	$(CC) $(FLAGS)  $(DEFINES) $(INCLUDES) $(LIB_DIRS) -c -o $@ $<
+all: $(TARGET)
 
 clean:
 	rm -rf $(TARGET) $(OBJECTS)
 
 install: $(TARGET) $(MAN)
-	$(INSTALL) -o root -g root -m 0755 $(TARGET) $(PREFIX)/bin
+	$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
+	$(INSTALL) -o root -g root -m 0755 $(TARGET) $(DESTDIR)$(PREFIX)/bin
 	
 
 uninstall: