Handle empty lines in define
diff --git a/parser.go b/parser.go
index 09f407f..7d8f290 100644
--- a/parser.go
+++ b/parser.go
@@ -420,10 +420,6 @@
 	for !p.done {
 		line := p.readLine()
 
-		if len(bytes.TrimSpace(line)) == 0 {
-			continue
-		}
-
 		if len(p.inDef) > 0 {
 			line = p.processDefineLine(line)
 			if trimLeftSpace(string(line)) == "endef" {
@@ -443,6 +439,10 @@
 			continue
 		}
 
+		if len(bytes.TrimSpace(line)) == 0 {
+			continue
+		}
+
 		if p.isDirective(string(line), makeDirectives) {
 			line = p.processMakefileLine(line)
 			p.parseKeywords(string(line), makeDirectives)